Subject Re: [firebird-support] Bug with character sets
Author Martijn Tonies
Hello Kjell,

>>> But how does the -client- know what bytes are significant and what
>>> bytes aren't?
>>
>> You are right - client has no idea about length of data in
>> characters, that's why it just fill whole buffer with spaces.
>
> Client has to determine number of characters by dividing buffer size
> with "max bytes per character". For char(2) data in utf8, buffer size
> will be 8 byte, and max bytes per character is 4, so the data should eb
> trimmed to 2 characters (codepoints).
>
> That's what Milan said.

We've had a 1-char example, Milan explained "4 bytes / 4 bytes per
char", so only 1 char.

But my question hasn't been answered:

How is this buffer filled and how do you know what bytes are significant
and what bytes aren't?

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com