Character encoding problem - Mailing list pgsql-jdbc

From Boris Klug
Subject Character encoding problem
Date
Msg-id 200302121550.11072.boris.klug@control.de
Whole thread Raw
Responses Re: Character encoding problem
List pgsql-jdbc
Hello!

we are using PostgreSQL DBs with Java for quite a long time. Now we upgraded
to PostgreSQL 7.3.1 and now we have a problem:

We have to PostgreSQL dbs on two different servers, both with Debian Linux
2.4.18. Java is a SDK 1.4.

I created the dbs using standrd enconding with leads to SQL_ASCII encoding.
Now I created a table with a varchar field and inserted tet with German
umlauts:
    create table umlauttest (txt varchar(50));
    insert into umlauttest values('üäö ÜÄÖ ß');

using psql I can verify that the umlauts are correctly stored in the db. Using
pg73b1jdbc2 (build 104) I can retrieve the umlauts on one machine but only
get questions marks on the other. Why?
Using pg73rc1jdbc2 (build 106) I get an ArrayOurOfBounce error on both
machines. Using pg73jdbc2 (build 108) I get the following exception:
"Invalid character data was found.  This is most likely caused by stored data
containing characters that are invalid for the character set the database was
created in.  The most common example of this is storing 8bit data in a
SQL_ASCII database."

OK, so I created the db using "initdb -E LATIN1" which does not helped. Using
"initdb -E UNICODE" will give even more problems: I wasnt able to insert
umlauts using psql...

So I am now totally confused about char encoding in PostgreSQL and in jdbc...
Can you help?



--
Dipl. Inform. Boris Klug, control IT GmbH, Germany

pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: omitted line in errors.properties (7.3.2)
Next
From: Thomas O'Dowd
Date:
Subject: Re: [HACKERS] Wrong charset mappings