Received: from ext16.sra.co.jp (IDENT:root@ykh28DS17.kng.mesh.ad.jp [133.205.214.17]) by hub.org (8.9.3/8.9.3) with ESMTP id VAA17881 for ; Sat, 15 May 1999 21:53:07 -0400 (EDT) (envelope-from t-ishii@ext16.sra.co.jp) Received: from ext16.sra.co.jp (t-ishii@localhost [127.0.0.1]) by ext16.sra.co.jp (8.8.8/8.8.8) with ESMTP id KAA00897; Sun, 16 May 1999 10:48:26 +0900 Message-Id: <199905160148.KAA00897@ext16.sra.co.jp> To: Martin Kuba cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] JDBC driver should use database encoding From: Tatsuo Ishii Reply-To: t-ishii@sra.co.jp In-reply-to: Your message of Fri, 14 May 1999 17:25:32 +0200. <373C406C.D5DCB492@inet.cz> Date: Sun, 16 May 1999 10:48:26 +0900 Sender: t-ishii@ext16.sra.co.jp > Postgres 6.4.2 has multibyte support, so database can be > in one of several encodings. But the JDBC driver uses > for fetching data this method: > > src/interfaces/jdbc/postgresql/ResultSet.java line 164: > return new String(this_row[columnIndex - 1]); > > It means that not the database internal encoding, but > the default encoding of client JVM will be used for > converting 8-bit characters to 16-bit UNICODE characters. > > In postgres 6.5beta is the same code, so I think next > release will have the same bug. > > Is it difficult to get the database encoding and use > it for converting bytes to Strings ? Is anybody planning > to do it ? If not, how can I do it ? Here in Japan we already have such a patch (for 6.4.2). I belive it can be used for any language, but I will ask the author of the patch to make sure that. --- Tatsuo Ishii