Re: SET client_encoding = 'UTF8' - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: SET client_encoding = 'UTF8'
Date
Msg-id 4572.1211205824@sss.pgh.pa.us
Whole thread Raw
In response to Re: SET client_encoding = 'UTF8'  (Daniel Migowski <dmigowski@ikoffice.de>)
Responses Re: SET client_encoding = 'UTF8'  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Daniel Migowski <dmigowski@ikoffice.de> writes:
> Kris Jurka schrieb:
>> On Sun, 18 May 2008, Daniel Migowski wrote:
>>> The command SET client_encoding = 'UTF8'
>
>> throws an exception in the driver, because the driver expects UNICODE.
>> This has been discussed before and the problem is that there are a too
>> many ways to say UTF8 [1].  You can say UTF8, UTF-8, UTF -- 8, and so
>> on. Perhaps we should strip all spaces and dashes prior to comparison?

Perhaps we should make the backend return the values of client_encoding
and server_encoding in canonical form (ie, "UTF8") regardless of the
spelling variant the user used.  I'm not thrilled with having JDBC
thinking it knows the conversion algorithm the backend uses.

Of course, such a change would break code relying on the older behavior
:-(

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Daniel Migowski
Date:
Subject: Re: SET client_encoding = 'UTF8'
Next
From: Oliver Jowett
Date:
Subject: Re: SET client_encoding = 'UTF8'