Re: getTables() doesn't handle umlauts correctly - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: getTables() doesn't handle umlauts correctly
Date
Msg-id alpine.BSO.2.00.1011230301020.26635@leary.csoft.net
Whole thread Raw
In response to Re: getTables() doesn't handle umlauts correctly  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: getTables() doesn't handle umlauts correctly
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: JDBC Commitfest/Reviewfest/Rehash of old issues
Next
From: Thomas Kellerer
Date:
Subject: Re: getTables() doesn't handle umlauts correctly