Rép : encodings in V4RB

Jules Jacquot Jules.Jacquot at wanadoo.fr
Mon Jul 28 09:02:55 CDT 2003


Le dimanche, 27 juil 2003, à 10:45 Europe/Paris, Ruslan Zasukhin a  
écrit :

> on 7/27/03 10:12, Carlo Rubini at osb at bttb.net.bd wrote:
>
> Hi Carlo,
>
> I have CC this to Valentina list.
> You need talk about encoding on list.
> Problem is that I am total dump in the encoding in RB and cannot give
> advice. But at least 5-8 developers have ask about the same problem on  
> list
> and they did get help there. BTW, you can check list archive.
>
> As I recall, you must encode/decode all strings that you send to  
> Valentina
> to/from MacRoman.
>
>
>> Hi Ruslan,
>> it's a few days that I'm struggling in porting an application of mine
>> from RB 4.5.3 to 5.2 (using V4RB 1.9.6)
>>
>> In RB 4.5.3 I didnt have any problem, but now, with RB 5.2 I do have
>> a couple of problems:
>>
>> 1. I make a list of words in BBEdit and import them into a valentina
>> db: the words are:
>> evening morning élitist (I hope the email respects the first char of
>> the 3rd word; anyway, it just an accented vowel).  If I open the
>> newly made .dat file, I can see the three words spelled correctly.
>> The problem is when I try to query the database about those three  
>> words:
>>
>> dim myword as string
>>
>>    myword = "élitist"
>>    dictCursor = nil
>>    dictCursor =  dictDatabase.SQLselect("Select words from
>> Dictionary where words = '"+myword+"'")
>>    if dictCursor(0).RecordCount > 0 then
>>       beep
>>    end

You can't do this.
words and myword don't speak the same language.
You must to synchronise them and that is the problem.


>>
>> 2. If a want to add a word containing accented vowels, once they are
>> added to the db, with the above code I cant get them. Add-code is:
>>  myword = "opértü"//I just made up a word containing accented chars
>>  dictDatabase.mDictionary.Wordsfield.Value = myword
>>  dictDatabase.mDictionary.AddRecord

try
dictDatabase.mDictionary.Wordsfield.value=defineencoding(myword,encoding 
s.UTF8)

RB encode in UTF8
If you want another encoding you can write this

dictDatabase.mDictionary.Wordsfield.value=convertencoding(myword,encodin 
gs.(the code that you want))

best

jules



More information about the Valentina mailing list