Subject | Re: [firebird-support] Bug with character sets |
---|---|
Author | Martijn Tonies |
Post date | 2009-05-20T11:19:36Z |
>> But the (X)SQLDA does not contain N. It does however contain charset id,Mark, correct, you decode and you know the number of characters.
>> which can be used to obtain "max bytes per char", which can be used in
>> combination with the buffer size specified in SQLDA to determine N.
>
> That is not correct. If I use UTF-8, one character can be 1 to 4 bytes.
> Using the buffersize and the 'max bytes per char' you will NOT be able to
> compute the characterlength.
>
> Example:
> buffer length of 4 bytes, UTF-8 (max 4 bytes per character): is this 1, 2,
> 3 or 4 characters? You simply don't know until you decode.
The problem is, the buffer is padded with spaces and those are valid
characters.
Now, how many of those decoded valid characters do you need? That's
the problem at hand.
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