Page 1 of 1

Ver 6.6.6 stable postgres and UTF8

Posted: 16.04.2010, 17:18
by Brekko
Hi all, I'm using version 6.6.6 stable to connect to a postgres server.
I created a new database using UTF8 as charset.
I created then a table with a character varying field named description.

If I execute a query from pgAdmin III like this:
insert into table_name (description) values ('test accented chars àèìòù.');
the record is stored correctly.

Executing the same query by copying exactly the same text in the SQL.Text property of a TZQuery object I see the following error:

Project Project1.exe raised exception class EZSQLException with message 'SQL Error: ERROR: invalid byte sequence for encoding "UTF8": 0xe0e8ec
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".

Is it a known bug with UTF8 or am I missing something?

I also tried with version 7.0.0 alpha and it raises the same exception.

Thank you very much.

Posted: 17.05.2010, 11:00
by olivdaum
Visibly, every body have this problem, but not ZeosLib development team, neither developers who don't work with UTF8.

What a disappointment ! Those components are powerfull and bugless than PostgresDAC components in my applications. :(

When a european developper integrate team ?
:lol:

Posted: 17.05.2010, 15:19
by seawolf
Please check that server and client have the same encoding

Set TZConnection.Options adding
codepage=utf8
client_encoding=utf8

Remember Zeos 6.x does not support utf8
Zeos 7.x support utf8, but at the moment is on alpha stage, so you could encounter problems.

Posted: 17.05.2010, 19:34
by olivdaum
Yes, but that doesn't work ! :wallb:

Posted: 17.05.2010, 19:40
by seawolf
It works only for Delphi 2009 -2010 (maybe Lazarus, but i'm not sure) and Zeos 7

Posted: 17.05.2010, 20:32
by olivdaum
Finally ! Here is the explanation :hiding:

Posted: 18.05.2010, 10:36
by guidoaerts
utf8 works with zeos6.6.5-stable, firebird 2.1 and lazarus0.9.26.2

Posted: 18.05.2010, 20:53
by olivdaum
:sorry:
I don't believe you !

Posted: 18.05.2010, 21:07
by seawolf
Me too, first of all because Zeos 6.x uses Ansi functions,
and Fb, starting from the upcoming 2.5 has a better codepages support

Posted: 19.05.2010, 08:18
by guidoaerts
at least I think it's working, I have it up and running. had some troubles getting it on the rails (http://zeos.firmos.at/viewtopic.php?t=2779), but up to now it seems ok. for now just running on the xp pc on which i work, might fail when distributing. will keep you posted.

take a look here :
http://zeos.firmos.at/viewtopic.php?t=1 ... 8862bc2a22