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

Problems with charsets, investigated...

From: Alexandre Aufrere <alexandre(dot)aufrere(at)inet6(dot)fr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problems with charsets, investigated...
Date: 2004-08-06 14:43:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

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 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, and it seems the bad behaviour is still there. 

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


Alexandre Aufrere


pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-08-06 16:05:54
Subject: Re: Problems with charsets, investigated...
Previous:From: Robert BowenDate: 2004-08-06 12:05:16
Subject: No suitable driver error trying to connect to postgresql from jdeveloper

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