On 18-4-2017 17:20, Dimitry Sibiryakov wrote:
> 18.04.2017 17:13, Jiří Činčura wrote:
>> Hmm. Can you elaborate on that?
>
>    Server doesn't determine real length of string in characters, so it just 
> pad string up
> to 4*MaxChars bytes with spaces. That's why for CHAR(20) you always get 80 
> bytes of data,
> which can contain more that 20 characters if you count trailing spaces as 
> well.
>    And there is no place in API where real length in bytes can be provided 
> for CHAR() type.
>    Because of that handling of CHAR() is broken in many places for UTF-8 and 
> alike charsets.
>

Real length in characters of a CHAR is length / max bytes per character, 
so for UTF-8: length / 4.

Mark
-- 
Mark Rotteveel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to