From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: getTables() doesn't handle umlauts correctly
Date: Mon, 22 Nov 2010 14:50:38 +0100
Message-ID: <icdsfe$7j8$1@dough.gmane.org> (raw)
In-Reply-To: <icdqc3$v7n$1@news.albasani.net>
References: <icc7cc$19a$1@dough.gmane.org>
<icdqc3$v7n$1@news.albasani.net>
Lew, 22.11.2010 14:14:
>> stmt = con.createStatement();
>> stmt.executeUpdate("create table public.umlaut_test_รถ (id integer)");
>> rs = con.getMetaData().getTables(null, "public", "umlaut_test%", null);
>> while (rs.next())
>> {
>> System.out.println(rs.getString("TABLE_NAME"));
>> }
>>
>> It will not display the table name correctly.
>>
>> Now on the console this might be an encoding problem of the client, but
>> the name is also not displayed correctly, when e.g. using a Swing JLabel
>> component which is fully UTF-8 compatible.
>>
>> Is there a connection parameter for the driver to return that correctly
>> or is this a driver bug?
>>
>> I'm using the 9.0-801 driver with a 9.0.1 database running on Windows XP
>
> Sounds like your database character encoding doesn't match up.
select pg_encoding_to_char(encoding) from pg_database returns UTF8 (for all databases)
I verified that my Java code was compiled using UTF-8 as well, to be sure nothing was lost there.
The problem also shows up when using a JDBC based query tool.
Btw: the same happens with pgAdmin as well.
The above created table will be displayed with an "empty" Name in the pgAdmin tree
Regards
Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: getTables() doesn't handle umlauts correctly
In-Reply-To: <icdsfe$7j8$1@dough.gmane.org>
References: <icc7cc$19a$1@dough.gmane.org> <icdqc3$v7n$1@news.albasani.net> <icdsfe$7j8$1@dough.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox