pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Herbert <Marc.Herbert@continuent.com>
To: pgsql-jdbc@postgresql.org
Subject: java UTF8 etc. (Re: Upgrading driver from 7.4 to 8.1)
Date: Mon, 29 May 2006 12:24:56 +0200
Message-ID: <khjmzd1ku13.fsf_-_@meije.emic.fr> (raw)
References: <28011CD60FB1724DBA4442E38277F62601533017@hermes.computec.de>
	<1371.1148501672@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> 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






Message-ID: <khjmzd1ku13.fsf_-_@meije.emic.fr>
Permalink:  ../khjmzd1ku13.fsf_-_@meije.emic.fr/
Also on:    postgresql.org/message-id/khjmzd1ku13.fsf_-_@meije.emic.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: Marc.Herbert@continuent.com
  Subject: Re: java UTF8 etc. (Re: Upgrading driver from 7.4 to 8.1)
  In-Reply-To: <khjmzd1ku13.fsf_-_@meije.emic.fr>
  References: <28011CD60FB1724DBA4442E38277F62601533017@hermes.computec.de> <1371.1148501672@sss.pgh.pa.us> <khjmzd1ku13.fsf_-_@meije.emic.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox