X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9F26A5E46C6 for ; Fri, 6 Aug 2004 11:43:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83966-06 for ; Fri, 6 Aug 2004 14:43:42 +0000 (GMT) Received: from smtp.ies.inet6.fr (www01.ies.inet6.fr [62.210.153.201]) by svr1.postgresql.org (Postfix) with ESMTP id E3CCB5E46BF for ; Fri, 6 Aug 2004 11:43:35 -0300 (ADT) Received: by smtp.ies.inet6.fr (Postfix, from userid 101) id A2DC3400E5; Fri, 6 Aug 2004 16:43:38 +0200 (CEST) Received: from localhost (web01 [127.0.0.1]) by smtp.ies.inet6.fr (Postfix) with ESMTP id 7533040118 for ; Fri, 6 Aug 2004 16:43:36 +0200 (CEST) Received: from smtp.ies.inet6.fr ([127.0.0.1]) by localhost (web01.inet6.ies [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25964-09 for ; Fri, 6 Aug 2004 16:43:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by smtp.ies.inet6.fr (Postfix) with SMTP id 933C4400E5 for ; Fri, 6 Aug 2004 16:43:35 +0200 (CEST) To: pgsql-jdbc@postgresql.org From: Alexandre Aufrere Reply-To: alexandre.aufrere@inet6.fr X-Apparently-from: alexandre.aufrere@inet6.fr@localhost X-Remote-Host: 62.210.105.37 User-Agent: NikoSoft WebMail Date: Fri, 06 Aug 2004 16:43:35 +0200 Subject: Problems with charsets, investigated... Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20040806144335.933C4400E5@smtp.ies.inet6.fr> X-Virus-Scanned: by IES Virus/Spam scanner at inet6.ies X-Spam-Trusted: X-Spam-DCC: sgs_public_dcc_server: web01.inet6.ies 1199; Body=1 Fuz1=1 Fuz2=1 X-Spam-Assassin: No hits=0.2 required=4.5 X-Spam-Untrusted: X-Spam-Pyzor: Reported 0 times. X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/45 X-Sequence-Number: 10767 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