[V4RB] Still Unicode troubles
Peter De Berdt
peter.de.berdt at pandora.be
Sat Jul 24 10:01:58 CDT 2004
On 23 Jul 2004, at 20:17, Ruslan Zasukhin wrote:
> On 7/23/04 8:29 PM, "Eric Ferrer" <wonderfef at noos.fr> wrote:
>
> Hi Eric,
>
>>> Valentina 1.x cannot work with unicode.
>>> You must not store unicode strings into Valentina,
>>> This will glitches.
>> OK, but...
>>
>>>> I thought that there was a mean to force Valentina to open a
>>>> database with
>>>> something like 'native OS' command for this purpose, but I can't
>>>> find this
>>>> in the documentation...
>> Was I dreaming?
>
> I have not understand question.
>
Eric, you have to make a module containing 2 methods:
1. FOR EACH OPERATION THAT GETS RECORDS FROM VALENTINA INTO RB
Function unicode(textstring as string) As string
return
convertEncoding(defineEncoding(textstring,encodings.systemDefault),encod
ings.UTF8)
End Function
2. FOR EACH OPERATION THAT INSERTS OR UPDATES RECORDS IN VALENTINA FROM
RB
Function ascii(tekst as string) As string
return
convertEncoding(defineEncoding(tekst,encodings.UTF8),encodings.systemDef
ault)
End Function
Then you can just do something like:
myCursor=myDB.SQLSelect("SELECT * FROM Table WHERE
myField='"+asciicode(myQuery)+"'")
and
myEditField.text=unicode(mCursor.VarCharField("MyField").value)
Best regards
Peter De Berdt
More information about the Valentina
mailing list