Page 1 of 1

ZConnection.Properties syntax

Posted: 09.04.2010, 16:33
by guidoaerts
Hello all,
Can anyone tell me what is the right way to set a character set (and eventually collation order) for the connection with a firebird database?

Guido

Posted: 11.04.2010, 12:56
by guidoaerts
Woolfik used 'codepage = ... ' in
http://zeos.firmos.at/viewtopic.php?t=2776
on th 6.6 -stable forum, but he didn't get any answer yet

Posted: 13.04.2010, 14:12
by guidoaerts
I work on win XP, lazarus 0.9.26.2, zeos 6.6.5 stable, firebird 2.1.2
my database is in utf8, xp and lazarus work in utf8, I have 'codepage=utf8' in ZConnection.properties, still my dbgrid show an empty string for fields that contain non ascii chars, like 'é'.
What's wrong? Any caption that I fill with AnsiToUTF8(fieldbyname('xx').asstring) will display properly. Is dbgrid in Ansi by default? and how can I change it to display utf8?
Desperate,
Guido

Posted: 15.04.2010, 17:40
by guidoaerts
Ok, for those who are interested..
Seems that even if firebird database is in utf8, it accepts anything. I copied data from a firebird database with default character set=none to one with default character set = utf8 using OpenOffice odbc. I was thinking, as openoffice works with unicode, now the data in my new database would be in utf8. Not true.
I had to get all the stringfields from the old database, convert the contents to utf8 using AnsiToUTF8() and update the new database.
Now everything works fine.