[Lazarus] Zeoslib and string encoding
svaa at ciberpiula.net
Tue May 10 10:23:03 CEST 2016
I'm using Lazarus 1.6 svn: 5163, on Windows XP
I'm porting a small utility that connects to a Firebird database. The
utility uses Zeoslib and as Zeoslib has been ported to Lazarus it was
almost straight, but I have come across with a problem.
In some place it calls Field.size, but returns the double of the real
size of the field. I read that it could be related to character
encoding. It assumes that for utf-8 or utf-16 and it could need twice
bytes to store the same characters.
The question is that the database has as default character set win1252,
all the fields are win1252. The Zeos connection component has a property
"ClientCodePage" that allows values UTF8 and UNICODE_FSS, There is
another property "AutoencodeString" boolean. No combination works, I
always get double size.
I can't change the Database codepage, and it must run on a W-XP, so as a
quick workaround I just made the dirty hack of dividing by 2 the result
But now, I've read a thread in freepascal about encoding and I wonder
wether the problem is more related to freepascal 3.0 than to zeoslib. Is
there some compiler directive about string encoding I should be aware of?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus