[solved] Spanish accents

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
skaw
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 03.12.2007, 18:27

[solved] Spanish accents

Post by skaw »

Hi

when i do an

insert into t_persons (name) values ('áéíóú');

i got an

insert into t_persons (name) values ('áéíóú');

on

function TZPostgreSQLStatement.ExecuteUpdate(const SQL: string): Integer;
var
QueryHandle: PZPostgreSQLResult;
ConnectionHandle: PZPostgreSQLConnect;
begin
Result := -1;
ConnectionHandle := GetConnectionHandle();
{$IFDEF DELPHI12_UP}
QueryHandle := FPlainDriver.ExecuteQuery(ConnectionHandle,
PAnsiChar(UTF8String(SQL)));
{$ELSE}
....

due the UTF8String(SQL) statement. When i replace the

QueryHandle := FPlainDriver.ExecuteQuery(ConnectionHandle,
PAnsiChar(UTF8String(SQL)));

in TZPostgreSQLStatement.ExecuteUpdate function by

QueryHandle := FPlainDriver.ExecuteQuery(ConnectionHandle,
PAnsiChar(ansistring(SQL)));

i get it solved... but i dont like to modify sources directly....

Is there a elegant solution?... i try to use CODEPAGE=utf8 but it doesnt work...

Best regards :roll:
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

skaw,

Yes there is one. Just look here http://zeos.firmos.at/viewtopic.php?t=3427 and download my branch. Then set ZConnection.ClientCodePage=utf8 and ZConnection.PreprepareSQL=True and it should work like you want to have it...

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
skaw
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 03.12.2007, 18:27

Post by skaw »

Wow...!!!

worked really fine!!! good work!!!

will you merge with oficial trunk???

best regards
skaw
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

skaw,

That's what i want, logical. But not to be decided yet. I need some more happy people on my branch, i think. I know exactly what i'm doing there but it is another way then the trunk and testing goes. And it does exists since february 2012 and the other two branches over 5 years..

Btw. My branch does also support ANSI encoding. If your default encoding is not Unicode, then you can also chose your ANSI characterset. Or left the ClientCodePage empty and i switch always to the default one..

Enjoy, Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked