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

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 (view raw or flat)
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

pgsql-jdbc by date

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

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