Subject Re: [firebird-support] Bug with character sets
Author Kjell Rilbe
Dimitry Sibiryakov wrote:

>>RealLength is determined by using a server side "bytes per character",
>
> Nope. As Vlad said, on server RealLength is always == N for CHAR.
>
> On client RealLengthInChars cannot be determined from RealLengthInBytes.
> Consider this example: CHAR(4), containing some characters in UTF8
> encoding. First character has size 1 byte, second - 2 bytes and the last
> one is 4 bytes. RealLengthInBytes = 7, bytes_per_character = 4,
> buffer_size = 16. Show me the way to calculate RealLengthInChars (which
> is 3) from numbers above.

Martijn meant "reallengthincodepoints", and that *can* be determined as
(buffer size) / (max bytes per codepoint).

We don't require fbclient to apply that info to determine
reallengthinbytes, because, as you say, it will require all the intl
stuff to be brought into fbclient (bloat!).

But the *application* can use reallengthincodepoints to do the actual
trimming. It just needs to *get* that info from fbclinet, which it does
*not* today, but *could* if it were passed in XSQLVAR.sqlscale.

Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64