X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 31630D6FB5 for ; Tue, 23 Aug 2005 11:50:53 -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 00496-05 for ; Tue, 23 Aug 2005 14:50:50 +0000 (GMT) Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by svr1.postgresql.org (Postfix) with ESMTP id 89991D6F5A for ; Tue, 23 Aug 2005 11:50:49 -0300 (ADT) Received: obelix.askesis.nl 172.31.0.1 from 172.31.1.8 172.31.1.8 via HTTP with MS-WebStorage 6.0.6249 Received: from Panoramix by obelix.askesis.nl; 23 Aug 2005 16:50:54 +0200 Subject: Re: Is this error correct/possible? From: Joost Kraaijeveld To: Kris Jurka Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: References: <1124790915.27046.25.camel@panoramix.askesis.nl> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 23 Aug 2005 16:50:54 +0200 Message-Id: <1124808654.27046.52.camel@panoramix.askesis.nl> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.097 required=5 tests=[AWL=0.047, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/175 X-Sequence-Number: 13744 On Tue, 2005-08-23 at 09:34 -0500, Kris Jurka wrote: > It is allowed to be stored in the database because SQL_ASCII is not a real > encoding. SQL_ASCII allows you to store anything you want and doesn't > require you to tell the server what character set it actually is. The > problem is on the return end, the JDBC driver asks the server to always > return data in UTF-8 by setting the client_encoding appropriately. The > server has no idea what the original encoding of the data was, so it has > no means of converting it to unicode. It may happen to look like > u-double-dot in your particular pgadmin3 client's encoding, but if that > client's encoding was different it would show up as a different character. > This is why the JDBC driver bails out instead of just picking a > random character. OK. > > 2. If so, is this a JDBC bug? > > No. The JDBC documentation clearly states not to choose a SQL_ASCII > database for your data. > > http://jdbc.postgresql.org/documentation/80/your-database.html What if you don't have a choise? E.g. the database is already in SQL_ASCII? Can I convert the database from SQL_ASCII to UNCODE? TIA Joost