Skip site navigation (1) Skip section navigation (2)

Re: getTables() doesn't handle umlauts correctly

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getTables() doesn't handle umlauts correctly
Date: 2010-11-22 13:50:38
Message-ID: icdsfe$7j8$ (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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 (
>> {
>> 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


In response to


pgsql-jdbc by date

Next:From: venkata siva prasadDate: 2010-11-22 17:50:55
Subject: Insert null in int column
Previous:From: LewDate: 2010-11-22 13:14:42
Subject: Re: getTables() doesn't handle umlauts correctly

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group