[solved] Spanish accents
Posted: 13.06.2012, 08:58
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
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