Page 1 of 1

PostgreSQL+utf8+Delphi7 how to?

Posted: 05.10.2008, 08:35
by hudgi
Hi,
I'm back again and am happy about that. :)

I have to develop an application which should store data in Postgres. The front end should also accept Greek language data.

Could you suggest me something clever how to do it?

My questions so far:
Q1. Can I store Greek characters in ASCII encoded database? (I guess no)
Q2. Can I use utf8 encoded database with Zeos lib in Delphi7 which is not unicode enabled? How?
Q3. I planned to buy the Delphi 2009 but it lacks of solid Postgresql connection components.
Q4. When are you planning to support D2009 with unicode?

Many Thanks and Best Regards,
--Hudgi

Posted: 27.10.2008, 23:57
by trupka
I'm not familiar with Greek but I'm using Win1250 codepage and D7. Here is what works for me:
A1: Avoid that...
A2. Yes - ZConnection.Properties.Add('codepage=WIN1250'); // (or write it on design time...
Actually, replace WIN1250 with your codepage. PG client library will do conversion between database UTF8 and your client (windows) codepage.
A3. Recently bought D2007 and still working with Delphi 7 :-)

Posted: 28.10.2008, 19:21
by hudgi
Trupka,
thank you for answering my question.
trupka wrote:A2. Yes - ZConnection.Properties.Add('codepage=WIN1250');
A2 sounds good but unfortunately it didn't work for me (with the same encoding or with 1253 for Greek).
Connect method executes well, but when I try to open a ZQuery the back end reports this error:
'SQL Error: ERROR: invalid byte sequence for encoding "UTF8": 0xfc'#$A'HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".'
What should I do to solve this error.

Thank you,

--Hudgi