[V4RB] SQL Queries/RB5.1/Unicode

Stan R. Busk maxprog at mac.com
Fri Apr 25 20:35:58 CDT 2003


Hi,

I have tried this. I have added a new record with my word "metá" 
directly using my app compiled with RB5.1, that is storing UTF-8 to 
valentina directly. Query now works as expected! This seems to be the 
solution but it means I need to add a method to my app to convert all 
existing records to UTF8.

Then I just need to convert Valentina's strings back for displaying 
them to the user. ConvertFromUTF8(DB.Table.Field.GetString, 
SystemEncoding) works like a charm for me.

Is there a drawback storing UTF8 string to Valentina? what about 
sorting?

Stan

> I've found that if you store UTF-8 text in Valentina you can search
> for it from RB 5.x as long as it is a case-insensitive search. That
> means strictly byte-by-byte comparisons. If you do anything to the
> text (like Upper()) in a method to make the search case-sensitive, it
> fails (because the current Valentina can't do a unicode uppercase on
> chars of > 127 properly).
>
> FWIW, I abandoned converting to and from MacRoman when storing the
> text in Valentina -- it created more problems than it was worth (and
> of course lost non-Roman characters).
>
> Of course, all this will be unnecessary when Valentina handles UTF-8.
> So, Ruslan, is it OK for me to ask how this is coming?
>
> Jon
>> on 4/25/03 2:43 PM, Stan R. Busk at maxprog at mac.com wrote:
>>
>>>  Hi,
>>>
>>>  New RB5.1 uses Unicode UTF8 everywhere, this is great! But when you
>>>  take a string from an edit field to be part of an SQL query and this
>>>  string contains an accentuated character, it always returns 0 
>>> entries
>>>  found (works fine with raw ASCII characters though). I have tried to
>>>  convert this string in many ways unsuccessfully, basically from 
>>> UTF8 to
>>>  MacRoman. I almost tried everything getting wrong results like char 
>>> "à"
>>>  converted to "a'" and so on...
>>>
>>>  When I guess a Valentina VVarchar field encoding it returns 
>>> Base=&hA01
>>>  with Variant=0 when it contains no accentuated chars but nil when it
>>>  does!
>>>
>>>  I know UTF8 support is being added to Valentina and I will likely 
>>> then
>>>  convert all my database strings to it but on the meantime I would 
>>> like
>>>  to know how could I make it work with my current database strings,
>>>  basically how can I take an UTF8 string and add it to my SQL query
>>>  securely?
>>
>> Well, for old RB you send to Valentina strings in MacRoman, correct?
>>
>> And String/VarChar field must have correct language to be set.
>>
>> So if you have correct language, and in RB 5.1 you convert to MacRoman
>> before you send to Valentina then must work...
>>
>> May be somebody else have more info.
>>

-- 
MAX Programming, LLC
<http://maxprog.com>



More information about the Valentina mailing list