Small problem with special characters

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Small problem with special characters
Date: 2006-08-20 12:17:14
Message-ID: ec9jsb$v5e$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

I'm having a small problem with inserting german umlauts. The PG database was
created with the default code page (by accident) and thus ended up with 'WIN1251'.

Now from within a Java program I'm trying to insert a value into the database
that contains the character 'ö'. Now when doing that, the JDBC driver throws an
error:

character 0xc3b6 of encoding "UTF8" has no equivalent in "WIN1251" [SQL
State=22P05]

What I don't understand, is that this character is contained in the windows code
page. The value itself is retrieved from a JDBC connection to a HSQLDB database,
so the string handling is Java internal only.

I can convert the database to UTF8 that is not the problem, the main reason I'm
writing, is that I'd like to understand what is going on here.

Does this mean, that I can only access UTF8 enabled databases with the JDBC driver?

Thanks
Thomas

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2006-08-20 15:46:21 Re: Small problem with special characters
Previous Message Hari 2006-08-18 19:02:07 JDK5 and TimeTest