Received: from uni2a.unige.ch (uni2a.unige.ch [129.194.8.41]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0U9bHq01784 for ; Tue, 30 Jan 2001 04:37:17 -0500 (EST) (envelope-from Jean-Francois.Burdet@adm.unige.ch) Received: from adm.unige.ch ([129.194.18.70]) by uni2a.unige.ch (PMDF V6.0-24 #44957) with ESMTPS id <01JZIK9DV92M000TSH@uni2a.unige.ch> for pgsql-jdbc@postgresql.org; Tue, 30 Jan 2001 10:37:08 +0100 (MET) Date: Tue, 30 Jan 2001 09:37:06 +0000 From: Jean-Francois Burdet Subject: Re: Re: [INTERFACES] jdbc: v7.1 bug (letter accent) To: pgsql-jdbc@postgresql.org Message-id: <3A768B42.8BED16AB@adm.unige.ch> MIME-version: 1.0 X-Mailer: Mozilla 4.76 [en]C-CCK-MCD (WinNT; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Accept-Language: en References: <3A754FD2.A0921E05@adm.unige.ch> <3A75B4D6.6B05E96D@xythos.com> X-Archive-Number: 200101/93 X-Sequence-Number: 98 After doing some search, I found that encoding used for the JDBC connection default to the JVM encoding, so I had add a Property to the connection : info.put("user","fsft"); info.put("password","fsft"); info.put("charSet", "ISO8859_1"); dbCon = DriverManager.getConnection(url,info); And quoted from Barry : > Let me explain a little bit more what is happening here. > In 7.0, the jdbc driver always used the clients default encoding to > convert text returned from the database into java Strings. This > obviously isn't correct when the DB happens to be running with a > different character set than the client. > So in 7.1 the jdbc drivers have been changed to detect the character set > of the database (by making the select getdatabaseencoding(); call). So > if your database was created with the wrong character set (i.e. not > latin1), then this change in behaviour would account for your problem. > Likewise if the database was created with the correct character set, it > should work fine without setting any additional properties. > As you point out, in 7.1 it is also possible to override the character > set used by setting the property you have mentioned below. However this > should not be necessary if the database is created with the correct > character set.