Bug in TZReadOnlyQuery and TZQuery

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
jaromir
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 20.01.2009, 12:52

Bug in TZReadOnlyQuery and TZQuery

Post 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
jaromir
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: 20.01.2009, 12:52

Post 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
olivdaum
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 11.05.2010, 12:53
Location: France

Post by olivdaum »

I just tried,

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

It doesn't works.
Locked