Subject | Re: [firebird-support] Storing Delphi 2009 "UnicodeString" into database, UTF8? |
---|---|
Author | Helen Borrie |
Post date | 2009-05-19T08:56:59Z |
At 06:05 PM 19/05/2009, you wrote:
As far as I can find out (so far), in order to get them into UTF8 encoding, you'll need to convert them to a compatible WIN or ISO charset client-side and let the client lc_ctype and db-side column-defined charsets take care of transliterating them to UTF8 encoding. (That doesn't mean there's not a simpler solution out there: the TNT guys cracked UTF-8 for older Delphi years ago, after all.) Can't help the impression that Codegear jumped out of the frying-pan into the fire and/or the current situation reflects a W-in-P rather than a done deed.
Thes might lead you somewhere:
http://www.drbob42.com/examines/examinA7.htm
and
http://blog.marcocantu.com/blog/d2009_whitepaper1.html
./hb
>Never mind that, duh, our own dbExpress driver seems to handle this.UnicodeString is UTF-16, viz., 16-bytes squashed into 2-byte munchkins, known as "surrogate pairs". It's surrogate pairs you're getting into those 2-byte widechars. It is not UTF-8. D2009 has an AnsiString variant called UTF8String...but I have no idea how it maps to strings that Firebird could transliterate to UTF8.
>
> From Delphi 2009, I'm getting "WideChar" into the driver, is that sufficient
>to sture UnicodeString.
As far as I can find out (so far), in order to get them into UTF8 encoding, you'll need to convert them to a compatible WIN or ISO charset client-side and let the client lc_ctype and db-side column-defined charsets take care of transliterating them to UTF8 encoding. (That doesn't mean there's not a simpler solution out there: the TNT guys cracked UTF-8 for older Delphi years ago, after all.) Can't help the impression that Codegear jumped out of the frying-pan into the fire and/or the current situation reflects a W-in-P rather than a done deed.
>I'm having trouble to find this stuff in the Delphi Help :-/Are you sure they actually know what to tell you? ;-)
Thes might lead you somewhere:
http://www.drbob42.com/examines/examinA7.htm
and
http://blog.marcocantu.com/blog/d2009_whitepaper1.html
./hb