Do you have the non-working code handy? I was thinking the code might be doing some unnecessary conversion of the
Unicodestring 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
haveto 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@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.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@sharp.fm "There's a moon
> over Bourbon Street
> tonight..."