Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DEA821337B7A for ; Mon, 22 Nov 2010 09:25:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 21024-05 for ; Mon, 22 Nov 2010 13:25:16 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id A2A8D13364DE for ; Mon, 22 Nov 2010 09:25:10 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id oAMDP5Jm018810 for ; Mon, 22 Nov 2010 09:25:05 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id oAMDEhk2098679 for pgsql-jdbc@postgresql.org; Mon, 22 Nov 2010 09:14:43 -0400 (AST) (envelope-from news) From: Lew X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: getTables() doesn't handle umlauts correctly Date: Mon, 22 Nov 2010 08:14:42 -0500 Organization: albasani.net Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit In-Reply-To: Cancel-Lock: sha1:rT+CsMxr6I3+PgP5u/ltKAmBvF8= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9 Injection-Info: news.albasani.net; logging-data="11D2oGafZAaHabu8OPDg3Ip32ZFoSxTmme1W5pFkpn1X/irdAG64wadhstIRIB3qXYSlFxXH9Yq/ktUG7bzd8ZHXk29ONPiwG8PJNEmLEJ63j5feqUjJ0CcFNNjXrz7r"; mail-complaints-to="abuse@albasani.net" To: pgsql-jdbc@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/54 X-Sequence-Number: 21175 Thomas Kellerer wrote: > I noticed that the driver will return incorrect values for table names > that contain umlauts. Consider the following code: > > Class.forName("org.postgresql.Driver"); You only need to load the class once. > con = > DriverManager.getConnection("jdbc:postgresql://localhost/postgres", > "postgres", "password"); > 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. -- Lew