encoding in Valentina and RealBasic 5.2 (OS X)

Stan Busk maxprog at mac.com
Fri Aug 1 01:14:57 CDT 2003


Hi,

You have to convert the whole query string to MacRoman as well. RB 
strings are UTF-8.

dictCursor = dictDatabase.SQLselect(ConvertFromUTF8("Select * from 
myDictionary where words = '"+myword+"'", encodings.MacRoman))

~/Stan

> Hello,
> it's a few days I'm trying to add records to a valentina db and to 
> query them. Everything works fine untill the records dont contain any 
> accented character. In fact, adding a record with accented characters 
> in it, I'm not able to query it.
>
> I know that Valentina understands MacRoman encoding, while strings in 
> RB 5.2 are UTF8 by default; yet when I use the (shortened) code below 
> in OS 10.1.2, querying doesnt give any result (in OS 9.2 I have no 
> problem):
>
> 1. I add myword to my db:
>
> dim myword as string
> myword = "élitist"
> dictDatabase.mDictionary.Wordsfld.Value = 
> myword.convertencoding(encodings.MacRoman)
>
> 2. I query it:
>
> dim myword as string
> myword = "élitist"
> dictCursor = nil
> dictCursor =  dictDatabase.SQLselect("Select * from myDictionary where 
> words = '"+myword+"'")
> if dictCursor.RecordCount > 0 then
> beep
> end
>
> but I cant get any beep! I tried to query for 
> myword.convertencoding(encodings.MacRoman) but without success.
>
> Yet I'm sure that the answer to my problem should be very simple.
> Can anybody make the appropriate correction un my snippet so that it 
> may work in OS X and RB 5.2?
>
> Thanks,
> -- 
> Carlo



More information about the Valentina mailing list