Page 1 of 1

Delphi 2010 + Zeos 7 + Postgres 9.1 = utf-8

Posted: 10.11.2011, 14:36
by juliomar_m
bom dia
com a combinação acima
Delphi 2010
ZeosLib 7
Postgresql 9.1

Quando faço a gravação de em um campo varchar de um caminho ex: "C:\\Programa\\Dados\\"
ele grava no banco neste formato "C:\134\134Programa\134\134Dados\134\134"

faço uso da properties com "codepage=utf8" e tb com "client_enconding=utf8"

verifiquei que o mudança das informações estão na unit ZDbcPostgreSqlUtils.pas
na function EncodeString(const Value: string): string;

este trecho está colocando o "134"

for I := 1 to SrcLength do
begin
if SrcBuffer^ in [#0, '''', '\'] then
begin
DestBuffer[0] := '\';
DestBuffer[1] := Char(Ord('0') + (Byte(SrcBuffer^) shr 6));
DestBuffer[2] := Char(Ord('0') + ((Byte(SrcBuffer^) shr 3) and $07));
DestBuffer[3] := Char(Ord('0') + (Byte(SrcBuffer^) and $07));
Inc(DestBuffer, 4);
end
else
begin
DestBuffer^ := SrcBuffer^;
Inc(DestBuffer);
end;

mas verifiquei no mantis do zeoslib e tem um post constando como correção mas acho que essa correção causou erro

alguém usa ou sabe algo a respeito??

Posted: 06.03.2012, 10:10
by EgonHugeist
Can you tell us your issues in english please?

Posted: 27.03.2012, 17:04
by infoluck
HELLO

When you save a path in postgres 9.x
placing the zeos truncates the character 134

example:

c: \ Folder \ SubFolder returns:

c: \ 134Pasta \ 134SubPasta.

Someone already has the fix for this?

Thanks
LUMORAES - BRAZIL.

Posted: 27.03.2012, 20:58
by EgonHugeist
infoluck wrote: When you save a path in postgres 9.x
Where do you post this example-path?

I know Zeos escapes the '\' to \134 becouse of some char-convertations..

was i written like 'c: \ 134Pasta \ 134SubPasta. ' in the database?
does it happen with PG7-8 too? If not then PG changed the escape-chars.

Best regards,

EgonHugeist

Posted: 01.04.2012, 00:12
by EgonHugeist
Sorry my fault.

Yes this bug is solved in my testing-egonhugeist branch. But i don't know if trunk/testing are ready here.

Best regards.