TDbGrid Postgre

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
bmarcus
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.12.2008, 10:57

TDbGrid Postgre

Post 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
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

The problem is related to postgres charsetcode and client charsetcode, so be sure to specify it to ZConnection.properties.
icyman
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 09.06.2009, 09:30
Location: republic of korea

Post 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?
Locked