Page 1 of 1

Problems with codepages

Posted: 15.08.2008, 10:23
by climber
Hi to all!

I use following components:
ZConnection - ZQuery - DataSource - DBGrid
After that

Code: Select all

ZQuery1.Close;
ZQuery1.SQL.Text:='select * from data_filials';
ZQuery1.ExecSQL;
I see some strange meaningless symbols... It looks like win1252 encoding, but source symbols are in win1251 encoding (and default system encoding is win1251).

I tried:
1. write Codepage=cp1251 in ZConnection.Properties
2. write such code:

Code: Select all

ZQuery1.Close;
ZQuery1.SQL.Text:='set client_encoding to ''win1251''';
ZQuery1.ExecSQL;
ZQuery1.SQL.Text:='select * from data_filials';
(It forces Postgre to return query result in win1251 encoding). Also I tried use other encoding besides win1251 in first query...
3. Replace all "win1252" values to "win1251" in Windows Registry.

In any case result looks like Delphi (or Zeos?) consider query result encoding is win1252. Anybody knows, how to force them show correct encoding?

Posted: 15.08.2008, 18:36
by trupka
Maybe it must be Zconnection.Properties.Add('codepage=win1251');
I'm using win1250 in my apps (server is UTF8) and works without any problems.

Posted: 18.08.2008, 09:30
by climber
As I discovered recently, it's only a little bug in zeos 6.6.3. I have unistalled Delphi and zeos, and installed delphi and zeos 6.6.2 after that. Now all works :)