Re: Unicode confusion

From: Ian Barwick <barwick(at)gmx(dot)net>
To: "Chris Palmer" <chris(dot)palmer(at)geneed(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unicode confusion
Date: 2003-05-12 20:47:22
Message-ID: 200305122247.22745.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 12 May 2003 20:49, Chris Palmer wrote:
> Ian Barwick writes:
> > If it's any help, your code should work as expected. The hex
> > data you see (3F3F0A) is two question marks and an \n; I would
> > guess Java is not able to display the unicode characters in your
> > environment and is replacing them with '?'.
>
> What part of my environment are you referring to? It's not the terminal
> emulator (which Java has no knowledge of). Java does Unicode (in fact,
> there is no other choice). Is there some locale setting I can use? Is there
> a parameter I can use with the Pg JDBC driver or Connection object?

OK, put it another way: Java is not able to or does not want to print
the specified Unicode characters (the Yin / Yang symbol and something
squiggly IIRC) to your STDOUT. This is nothing to do with the JDBC connection.
I presume Java looks at your locale setting, maybe Google knows the
answer ;-).

Using a UTF-8 capable terminal (I use mlterm or konsole, no idea what options
there are in Windows) the characters retrieved from Postgres and which are now
in Java's internal Unicode encoding (which one I don't recall) can be
displayed by converting them into UTF-8.

Ian Barwick
barwick(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2003-05-12 20:48:59 create type question
Previous Message Achilleus Mantzios 2003-05-12 20:39:59 Re: epoch to timestamp