X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 025129FA315 for ; Mon, 29 May 2006 07:24:58 -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 73810-02 for ; Mon, 29 May 2006 07:24:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 08C8F9FA2C7 for ; Mon, 29 May 2006 07:24:46 -0300 (ADT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr4.postgresql.org (Postfix) with ESMTP id 606FC5AF959 for ; Mon, 29 May 2006 10:24:45 +0000 (GMT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FkevN-0007SQ-KN for pgsql-jdbc@postgresql.org; Mon, 29 May 2006 12:24:37 +0200 Received: from 83.145.96.118 ([83.145.96.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 May 2006 12:24:37 +0200 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 May 2006 12:24:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Marc Herbert Subject: java UTF8 etc. (Re: Upgrading driver from 7.4 to 8.1) Date: Mon, 29 May 2006 12:24:56 +0200 Lines: 22 Message-ID: References: <28011CD60FB1724DBA4442E38277F62601533017@hermes.computec.de> <1371.1148501672@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.118 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:GziEyKoBTRk9m4G/7f+l2Q7YAjI= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/140 X-Sequence-Number: 15268 Tom Lane writes: > FWIW, I think that Java clients don't need to worry about those security > issues. It's not possible for Java to emit an invalidly-coded UTF8 > string, is it? I thought that the internal representation of strings > is UCS2 or UCS4, and if so, it would take some exceedingly broken > code in the JVM for the output not to be valid UTF8. It's UTF-16, just like Windows XP and above. http://java.sun.com/developer/technicalArticles/Intl/Supplementary/ FYI there are two ways to output UTF8: DataOutputStream.writeUTF() outputs a non-standard UTF8, and is limited in size. From 1.4: Charset.forName("UTF-8")....encode() outputs standard UTF8