pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: stafford@marine.rutgers.edu
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Is UTF-8 required for PostgreSQL JDBC?
Date: Tue, 21 Nov 2006 14:07:37 +0100
Message-ID: <4562FA19.1050503@logix-tt.com> (raw)
In-Reply-To: <455E1C8D.5070704@marine.rutgers.edu>
References: <455E1C8D.5070704@marine.rutgers.edu>

Hi, Bill,

Wm.A.Stafford wrote:
> When installing PostgreSQL two weeks ago I thought I  read that the
> encoding for a DB that will be acccessed via JDBC must be UTF-8.  Is
> this correct?  I can not find the docs  page where I saw this and I'm
> beginning to wonder if I imagined it.

That's wrong, the database can be in any encoding you like.

The connection actually is encoded in UTF-8. PostgreSQL converts all
data between UTF-8 and the actual database encoding, and the JDBC triver
converts between UTF-8 and the JVM-internal unicode representation
(which is likely to be an UTF-16-derivate, as that's closest to what's
visible to the Java code).

Executing a "SET client_encoding TO foobar" through the JDBC driver may
break things for that one connection.

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



view thread (3+ messages)

Message-ID: <4562FA19.1050503@logix-tt.com>
Permalink:  ../4562FA19.1050503@logix-tt.com/
Also on:    postgresql.org/message-id/4562FA19.1050503@logix-tt.com

 · 

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: schabi@logix-tt.com, stafford@marine.rutgers.edu
  Subject: Re: Is UTF-8 required for PostgreSQL JDBC?
  In-Reply-To: <4562FA19.1050503@logix-tt.com>
  References: <455E1C8D.5070704@marine.rutgers.edu> <4562FA19.1050503@logix-tt.com>

* 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