Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6CE3A9FB3DD for ; Tue, 1 May 2007 13:05:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 65958-02 for ; Tue, 1 May 2007 13:05:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id B849D9FB4E4 for ; Tue, 1 May 2007 13:05:09 -0300 (ADT) Received: (qmail 32143 invoked by uid 1112); 1 May 2007 16:05:08 -0000 Date: Tue, 1 May 2007 12:05:08 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Altaf Malik cc: pgsql-jdbc@postgresql.org Subject: Re: JDBC Default Encoding In-Reply-To: <380653.13890.qm@web39107.mail.mud.yahoo.com> Message-ID: References: <380653.13890.qm@web39107.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/6 X-Sequence-Number: 16996 On Tue, 1 May 2007, Altaf Malik wrote: > In PGStream, i see the default encoding "US-ASCII" which is overridden > once we are connected to the database. But, if an error comes while > connecting to the database for example user name is not correct, > US-ASCII is used to decode the Server Message which prints ??? instead > of actual error message when the locale is other than english (in my > case it was zh_TW.utf8). If i change the default encoding of PGStream to > UTF8, it works fine. Is there any specific reason for the default > encoding to be the US-ASCII? > Prior to connecting to the database we cannot assume what encoding the conversation should occur in, so we use the lowest common denominator of US-ASCII. I guess the question is, with a database encoding of something other than UTF-8, does the error message come back in the database encoding or in UTF-8 like we asked. I'm not sure when the server applies our setting of client_encoding. If it does come back in UTF-8 that would be a good reason to switch to UTF-8 in the driver earlier, but if it comes back in the database encoding there's not much we can do about that. Kris Jurka