Character encoding problem

From: Boris Klug <boris(dot)klug(at)control(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Character encoding problem
Date: 2003-02-12 14:50:11
Message-ID: 200302121550.11072.boris.klug@control.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas O'Dowd 2003-02-12 15:13:51 Re: [HACKERS] Wrong charset mappings
Previous Message Tatsuo Ishii 2003-02-12 13:30:02 Re: Wrong charset mappings