Subject | Re: [firebird-support] Bug with character sets |
---|---|
Author | Kjell Rilbe |
Post date | 2009-05-20T10:42:22Z |
Dimitry Sibiryakov wrote:
(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
>>RealLength is determined by using a server side "bytes per character",Martijn meant "reallengthincodepoints", and that *can* be determined as
>
> 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.
(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