Problems with codepages

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
climber
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.08.2008, 09:45

Problems with codepages

Post 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?
trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Post 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.
climber
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.08.2008, 09:45

Post 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 :)
Post Reply