Re: getTables() doesn't handle umlauts correctly

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: getTables() doesn't handle umlauts correctly
Date: 2010-11-23 08:13:42
Message-ID: alpine.BSO.2.00.1011230301020.26635@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 22 Nov 2010, Thomas Kellerer wrote:

> What I find irritating is that I can run SELECT or INSERT statements against
> that table without problems.
>
> So the transmission of SQL Statements (through the Statement object) seems to
> be working with a different encoding...

As the discussion has shown, trying to determine who is at fault here is
not trivial. The best way to show that postgresql (driver or server if
you're seeing it in pgadmin too) is at fault is to create a test case
creating the table and then querying the metadata. It would be helpful to
use either a Java or PG escape code for the special character so it
doesn't get mangled by either mail clients or build environments. Then use
String.codePointAt to print out the actual data for both the table name
used for construction and returned by the metadata. That would
conclusively show that PG is at fault somewhere.

Something like this untested code:

void printString(String str) {
for (int i=0; i<str.length(); ) {
int cp = str.codePointAt(i);
System.out.print(" " + cp);
i += Character.charCount(cp);
}
System.out.println();
}

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2010-11-23 14:22:10 Re: getTables() doesn't handle umlauts correctly
Previous Message Kris Jurka 2010-11-23 07:58:54 JDBC Commitfest/Reviewfest/Rehash of old issues