Re: character sets and results

From: "Joe Shevland" <jshevland(at)j-elite(dot)com>
To: "Graham Leggett" <minfrin(at)sharp(dot)fm>, "Postgresql JDBC" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: character sets and results
Date: 2002-03-15 02:37:05
Message-ID: HEECIHEEJDBMCCGMGIOBEEKOCFAA.jshevland@j-elite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Do you have the non-working code handy? I was thinking the code might be doing some unnecessary conversion of the Unicode string that gets returned e.g.

String foo = rs.getString("foo");
String bar = new String(foo.getBytes("US-ASCII"));

might cause something similar. As Alaric mentioned, if you use Unicode as the database character set, you shouldn't have to worry about any of these issues. Last CJK application I wrote, the biggest issue was character data from/to the browser, is there any browser interaction or form postings going on?

Cheers,
Joe

> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Graham Leggett
> Sent: Thursday, 14 March 2002 21:42
> To: Postgresql JDBC
> Subject: [JDBC] character sets and results
>
>
> Hi all,
>
> I have been asked to fix a piece of code that submits queries to a
> database, and returns string data that could possibly contain characters
> with accents.
>
> When the code returns the data (using standard SQL select statements)
> the accented characters are replaced with a "?" character.
>
> I have some other code which works correctly using the same select
> statements, however in the other code a third party class is being used
> to handle the database connections - I assume therefore that the
> character sets being used are somehow specified on connection.
>
> I have been trawling the postgresql-jdbc docs some for dome kind of
> explanation on how to correctly handle different character sets, however
> I have had no luck. Can anyone shed some light? Am I looking in the
> right place?
>
> Regards,
> Graham
> --
> -----------------------------------------
> minfrin(at)sharp(dot)fm "There's a moon
> over Bourbon Street
> tonight..."

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-03-15 03:44:52 Re: Need to use JDK 1.4
Previous Message Hans Deragon 2002-03-14 23:41:34 Re: NullPointer at ResultSet.java:113