Subject Re: [firebird-support] Bug with character sets
Author Milan Babuskov
Martijn Tonies wrote:
> I'm not sure how much sense this makes to me :-)

I did not like it myself when I learned about it, but this is how it was
explained to me on firebird-devel a few months ago. And it does work.

> UTF8 has 1, 2, 3 or 4 bytes per character, right? So the buffer for
> characters is always "4 bytes" * "number of characters".

That's correct.

> But what happens
> in your particular case if the character is 2 bytes long? You cannot
> truncate it to the first byte (to get ASCII 'Y')?

You don't truncate it to number of bytes, you truncate it to number of
characters. It should be done using some function of your "string class"
(ex. wxString in FlameRobin) after you convert the string from UTF8 to
the character set used by user's desktop environment.

Regards,

--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com