Page 1 of 1

TDbGrid Postgre

Posted: 05.06.2009, 09:07
by bmarcus
HI,

I have problems when I read special characters like "ä", "Ü", "Ö" from my postgre Database and show the read texts on a DbGrid-component.

The TDbGrid-component is UnicodeString based, but the data in the TDataSource->TDataSet are UTF8 coded. So there is a problem when showing the data in DbGrid.

A single utf8 - string from database can be converted to unicodestring by unsing the "UTF8ToUnicodeString" function. So there is no problem to show the texts in a TDbLabel, but how can I solve the problem with the TDbGrid?

Thanks

Marcus

Posted: 05.06.2009, 12:30
by seawolf
The problem is related to postgres charsetcode and client charsetcode, so be sure to specify it to ZConnection.properties.

Posted: 10.06.2009, 05:17
by icyman
I think your problem is setting the property ZConnection.properites..

Examply, codepage=latin1 client_encoding=latin1 ....

You must set your intended code page for utf8, etc.

If you success to read the special characters in DBGrid,

try to edit field within the special characters and try to post it.

Then refresh the table. Is it correct the special characters and can you read it?