Subject | Re: [firebird-support] Re: Writing UTF16 to the database |
---|---|
Author | Brad Pepers |
Post date | 2005-02-16T08:20:46Z |
fxam wrote:
the database to sort the data for you in the right order. If you use
octets I believe your data will be sorted using memcmp which is not
using any idea of a character encoding and will be wrong for many encodings.
--
Brad Pepers
brad@...
>But doing this or even storing UTF-8 into a varchar ends the ability of
>>I'm writing in C and have started using wchar_t strings internally, and
>>wish to write the contents of these to a firebird db. However, having
>>set the character set for the VARCHAR field to Unicode_fss, only the
>>first character of the field is written to the field (as I guess it
>>finds that the second byte in the string is zero). Is there a function I
>>can use to write a wchar_t string (UTF-16) to this field?
>
> You can use VARCHAR OCTETS to store UTF-16, OCTETS accepts everything
> including nulls, but you have to try yourself whether you can retrieve back
> all the null characters in the field.
the database to sort the data for you in the right order. If you use
octets I believe your data will be sorted using memcmp which is not
using any idea of a character encoding and will be wrong for many encodings.
--
Brad Pepers
brad@...