Page 1 of 1

Bug in TZReadOnlyQuery and TZQuery

Posted: 09.03.2010, 11:17
by jaromir
Hi,

I have a problem with zeos in Delphi 2010.

Environment:
Delphi 2010, Zeos 7 (SVN 794), PostgreSQL (latest 8.4)

I'm sorry for image but it's simplest for me:

Image

Picture has upper and lower parts. In upper part we have connection to UTF8 database and in lower part WIN1250 database.
In both cases in DB connection properties we have set properties: codepage=... and client_encoding=..
Sample data is polish national signs.
Record with id = 1 was entered i outer software (EMS) but record with id = 3 was entered with ZUpdateSQL component (the same text as id = 1)

As you can see everything look OK when we have UTF8 database but there is a problem with WIN1250 encoding. There are 2 problems:
- TZReadOnlyQuery can't read correctly (outer entered data)
- TZUpdateSQL can't write correctly (own entered data) - but in the same time TZReadOnlyQuery read this data ok.

I know that solution is change DB encoding but for old projects it's not so simple solution for me.

Can anybody help ?

Regards:
Jaromir

Posted: 10.03.2010, 18:13
by jaromir
It seems that solution is like above:

DBConnection.Properties.Clear;
DBConnection.Properties.Add('codepage=UTF8');
DBConnection.Properties.Add('client_encoding=UTF8');

Even if you have DB encoded for example in WIN1250 (as me). I think that with above properties there is online reencoding from WIN1250 to UTF8 - postgresql server do this on the fly.

Regards
Jaromir

Posted: 11.05.2010, 14:06
by olivdaum
I just tried,

ZConnection1.Properties.Clear;
ZConnection1.Properties.Add('codepage=UTF8');
ZConnection1.Properties.Add('client_encoding=UTF8');

It doesn't works.