X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4724B9F9AD3 for ; Sun, 18 Jun 2006 05:10:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 60325-04 for ; Sun, 18 Jun 2006 05:10:47 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by postgresql.org (Postfix) with ESMTP id 69C369FA5E6 for ; Sun, 18 Jun 2006 05:10:47 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 55so810959wri for ; Sun, 18 Jun 2006 01:10:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=hg/teAdopyqRj+5CYbIDOldJT4lvc71Jmgf5lXuifMWeJj8tLF9akdmAjwf3D6YGEQAwPi2g9wSCzByYVu45MlhTszOdrY9F/LvRgZtmxep54xZVhNoMwRkf4CsFMRn7gYSa24KreZXTdB+rDvnjSkCiza6v9UvY3/D30VAQL9U= Received: by 10.65.93.17 with SMTP id v17mr4356339qbl; Sun, 18 Jun 2006 01:10:46 -0700 (PDT) Received: by 10.64.195.11 with HTTP; Sun, 18 Jun 2006 01:10:46 -0700 (PDT) Message-ID: <23adfcc00606180110g43045926o2badbc5aee77a2d3@mail.gmail.com> Date: Sun, 18 Jun 2006 11:10:46 +0300 From: "Yair Zas" To: pgsql-jdbc@postgresql.org Subject: A question about postgresql 8.1 and UTF strings MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_132842_15616671.1150618246184" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/42 X-Sequence-Number: 15322 ------=_Part_132842_15616671.1150618246184 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Good day all, I have postgresql 8.1 (on WINXP service pack 2). I have a table t_users with the columns id (serial), username ( varchar(256) ), and password ( varchar(256) ) The database was created with UT8 encoding. I have 5 users at the database, and some of them have non-latin (especially hebrew) usernames, i entered these non latin values simply by using the pgadmin gui (was i correct to do so?) to enter the non-latin strings. I opened a jdbc connection using a standard postgres JDBC URL and selected a recordset with a hebrew username. I used String user = ResultSet.GetString("username") to get the String (which contains 4 hebrew letters) and then I used System.out.println(user.getBytes().length) - however, instead of seeing 8 bytes (2 bytes per each character, 4 characters ), i saw 4 bytes .... Can you please tell me what is it that I'm doing wrong? Thanks Yair ------=_Part_132842_15616671.1150618246184 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Good day all,
I have postgresql 8.1 (on WINXP service pack 2).
I have a table t_users with the columns id (serial),  username ( varchar(256) ), and password ( varchar(256) )
The database was created with UT8 encoding.
I have 5 users at the database, and some of them have non-latin (especially hebrew) usernames, i entered these non latin values simply by using the pgadmin gui (was i correct to do so?) to enter the non-latin strings.
I opened a jdbc connection using a standard postgres JDBC URL and selected a recordset with a hebrew username.
I used String user = ResultSet.GetString("username") to get the String (which contains 4 hebrew letters)
and then I used
 
System.out.println(user.getBytes().length) - however, instead of seeing 8 bytes (2 bytes per each character, 4 characters ), i saw 4 bytes ....
Can you please tell me what is it that I'm doing wrong?
 
Thanks
 
Yair
 
------=_Part_132842_15616671.1150618246184--