Re: Encoding issue (utf8): different strings received from java than from PGAdmin - Mailing list pgsql-jdbc

From Albe Laurenz
Subject Re: Encoding issue (utf8): different strings received from java than from PGAdmin
Date
Msg-id AFCCBB403D7E7A4581E48F20AF3E5DB2020DE7F0@EXADV1.host.magwien.gv.at
Whole thread Raw
In response to Encoding issue (utf8): different strings received from java than from PGAdmin  ("Marc Mamin" <M.Mamin@intershop.de>)
Responses Re: Encoding issue (utf8): different strings received from java than from PGAdmin  ("Marc Mamin" <M.Mamin@intershop.de>)
List pgsql-jdbc
> The PG Database, the PG Client and java allworks in UTF8 context.
>
> create this postgres function that just write the input
> parameter in /opt/<pgdata>/pg_log/:
>
> CREATE OR REPLACE FUNCTION public.raisecode(v character varying)
[...]
>    RAISE WARNING 'raisecode output: %',v;
[...]
>
> 2) call "select raisecode('$§Kü§$')"
>    from a postgres client like PGAdmin
>
> 3) call the same statements from within a java application:
>    conn.createStatement().execute("select raisecode('$§Kü§$')");
>
> compare the output in pg_log:
>
> 2 => $§Kü§$
> 3 => $çKüç$

I tried, but cannot reproduce your problem.

Try to examine all the strings involved with 'od -c' and see where
your results differ from mine:

'od -c' on my Test.java and Test.class contain:

   s   e   l   e   c   t       r   a   i   s   e   c   o   d   e
   (   '   $ 302 247   K 303 274 302 247   $   '   )

'od -c' on my log file contains:

   r   a   i   s   e   c   o   d   e       o   u   t   p   u   t
   :       $ 302 247   K 303 274 302 247   $  \n

Is it the same for you?

Yours,
Laurenz Albe

pgsql-jdbc by date:

Previous
From: "Marc Mamin"
Date:
Subject: Encoding issue (utf8): different strings received from java than from PGAdmin
Next
From: Bellur Ashwin
Date:
Subject: Problem with Running Query