Re: Encoding issues

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Encoding issues
Date: 2008-08-02 08:56:40
Message-ID: 48942148.8060501@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Tom Lane wrote:
> Oliver Jowett <oliver(at)opencloud(dot)com> writes:
>> Jeff Davis wrote:
>>> or at least blindly pass the bytes on to the server?
>
>> What bytes? You have a bunch of UTF-16 characters (possibly with
>> surrogate pairs etc). What encoding do you use to turn that into a
>> bytestream?
>
> It wouldn't be entirely unreasonable to define the answer as "UTF-8".
> That would at least provide serviceable behavior to a goodly group of
> users, whereas the current implementation seems guaranteed to fail
> for everyone (other than us ASCII-only Neanderthals who don't care
> anyway...)

So then the restriction is "use 7-bit strings, or use a UTF-8 server
encoding"? That sounds reasonable.

How feasible would it be to have the backend transcode user/database
based on the client_encoding given in the StartupMessage? That would
leave authentication as the only remaining wart. It's a pity the current
protocol doesn't allow the backend to emit a ParameterStatus before
authentication is complete ..

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Steve Foster 2008-08-04 13:28:34 macaddr data type and prepared statements
Previous Message Tom Lane 2008-08-02 04:40:34 Re: Encoding issues