Character issue on Custom and Default NoticeProcessor

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
Densetsu7
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 01.04.2013, 20:43

Character issue on Custom and Default NoticeProcessor

Post by Densetsu7 »

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:

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();
PgAdmin recognizes that character and returns the right text, but my application doesn't.

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
  );
My database is UTF8 and I'm using Delphi XE2.

Thanks in advance.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello Densetsu7,

to me this seems to be some kind of character set conversion problem. Which IDE do you use? (Delphi version / Lazarus)? And what is the setting for TZConnection.ClientCodePage?

Best regards,

Jan
Densetsu7
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 01.04.2013, 20:43

Post by Densetsu7 »

Delphi XE2.
ClientCodePage is setting to UTF8 automatically, cause there's the following code on the Properties property: "CODEPAGE=UTF8".

Every data and special character conversion works fine. This problem at NoticeProcessor is the only issue that I actually figured out so far.

Thanks in advance.
Post Reply