Received: from aida.inet.cz (root@aida.inet.cz [194.196.192.1]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA17628 for ; Fri, 14 May 1999 11:20:53 -0400 (EDT) (envelope-from makub@inet.cz) Received: from inet.cz ([10.0.0.38]) by aida.inet.cz (8.9.0/8.9.0) with ESMTP id RAA09500 for ; Fri, 14 May 1999 17:19:24 +0200 Message-ID: <373C406C.D5DCB492@inet.cz> Date: Fri, 14 May 1999 17:25:32 +0200 From: Martin Kuba X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: cs,en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: JDBC driver should use database encoding Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Hi, 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 ? Martin -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INET, a.s. Mgr. Martin Kuba Kralovopolska 139 e-mail: makub@inet.cz 601 12 Brno WWW: http://www.inet.cz/~makub/ Czech Republic tel: +420-5-41242414/33 -------------------------------------------------------------------- PGP fingerprint = D8 57 47 E5 36 D2 C1 A1 C3 48 B2 59 00 58 42 27 http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub --------------------------------------------------------------------