Character issue on Custom and Default NoticeProcessor
Posted: 01.04.2013, 21:02
I was trying to receive the following message on my application:
"pDisparaFuncao(6,serviço)"
It happens that either using a custom NoticeProcessor (using SetNoticeProcessor method) or using the DefaultNoticeProcessor, my application receives the following message:
"pDisparaFuncao(6,serviço)"
Just created a varchar funcion at PostgreSQL as follows:
PgAdmin recognizes that character and returns the right text, but my application doesn't.
Here is the app code for SetNoticeProcessor:
My database is UTF8 and I'm using Delphi XE2.
Thanks in advance.
"pDisparaFuncao(6,serviço)"
It happens that either using a custom NoticeProcessor (using SetNoticeProcessor method) or using the DefaultNoticeProcessor, my application receives the following message:
"pDisparaFuncao(6,serviço)"
Just created a varchar funcion at PostgreSQL as follows:
Code: Select all
CREATE OR REPLACE FUNCTION sigh.f_notice_sem_acento()
RETURNS varchar AS
$BODY$
declare
begin
raise notice 'pDisparaFuncao(6,%)', 'serviço';
return '';
end
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
GRANT EXECUTE ON FUNCTION sigh.f_notice_sem_acento() TO public;
select sigh.f_notice_sem_acento();
Here is the app code for SetNoticeProcessor:
Code: Select all
procedure pNoticeProcessor(arg: Pointer; AMessage: PAnsiChar); cdecl;
var
s: string;
begin
s := AMessage;
pAviso(s);
end;
procedure TdtmPadrao.pSetNoticeProcessor;
begin
(dbPadrao.DbcConnection as IZPostgreSQLConnection).GetPlainDriver.SetNoticeProcessor(
(dbPadrao.DbcConnection as IZPostgreSQLConnection).GetConnectionHandle
, pNoticeProcessor
, Self
);
Thanks in advance.