Problems with charsets, investigated... - Mailing list pgsql-jdbc

From Alexandre Aufrere
Subject Problems with charsets, investigated...
Date
Msg-id 20040806144335.933C4400E5@smtp.ies.inet6.fr
Whole thread Raw
Responses Re: Problems with charsets, investigated...
Re: Problems with charsets, investigated...
List pgsql-jdbc
Hello,

I am using Postgresql 7.4.2 and its JDBC drivers, straight out from a FC2,
along with JDK 1.4.2 from Sun.
I use the JDBC driver in a web app using Enhydra appserver. Java correctly
sets its file.encoding property to the charset specified in the LANG
environment variable. However, it appears that whatever i set this
variable to, the JDBC driver seems to use UTF-8.

I have digged into the code, and seen that in the
AbstractJdbc1Connection.java class, the encoding is always forced to
"UNICODE" (therefore forcing UTF-8 on Java side).
From that, i patched the code to correctly use the file.encoding system
property to guess the charset.

As i didn't dig very long, and as it seems from what i see in cvsweb at
gborg that all this stuff could have changed deeply, i am not sure that
this would be useful to you. However i downloaded the latest dev builds at
jdbc.postgresql.org, and it seems the bad behaviour is still there.

So, did i miss something somewhere ? Are you interested in that (frankly
quite ugly) patch ?

Regards,

Alexandre Aufrere


pgsql-jdbc by date:

Previous
From: Ryoji Sawa
Date:
Subject: Re: [Fwd: Q: database schema from JDBC driver and netbeans.]
Next
From: syg6@yahoo.com (Robert Bowen)
Date:
Subject: No suitable driver error trying to connect to postgresql from jdeveloper