Re: UTF8 should be accepted as UNICODE

Lists: pgsql-jdbc
From: Ivo Danihelka <ivo(dot)danihelka(at)itonis(dot)tv>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: UTF8 should be accepted as UNICODE
Date: 2008-02-22 14:08:14
Message-ID: 1203689294.4960.56.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

The Postgresql JDBC driver does not accept this statement:
SET client_encoding = 'UTF8';

It fails with:
"org.postgresql.util.PSQLException: The server's client_encoding
parameter was changed to UTF8. The JDBC driver requires client_encoding
to be UNICODE for correct operation."

I consider that to be a bug. The UNICODE is an alias for UTF8.

Starting from 8.2, the pg_dump exports 'UTF8'
even when --encoding=UNICODE is used.
See:
$ pg_dump --version
pg_dump (PostgreSQL) 8.2.6
$ pg_dump --encoding=UNICODE template1 | grep client_encoding
SET client_encoding = 'UTF8';

The check for value.equals('UNICODE') is inside
org/postgresql/core/v3/QueryExecutorImpl.java

Thanks for the driver,
--
Ivo Danihelka


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Ivo Danihelka <ivo(dot)danihelka(at)itonis(dot)tv>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: UTF8 should be accepted as UNICODE
Date: 2008-02-22 14:21:03
Message-ID: E57CB639-3D98-4ECA-862A-11CF87DC003D@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Ivo,

What it's actually telling you is that you shouldn't attempt to change
it.

It's already set to UNICODE

But it should probably ignore your attempt, since it has no effect.

Dave
On 22-Feb-08, at 9:08 AM, Ivo Danihelka wrote:

> The Postgresql JDBC driver does not accept this statement:
> SET client_encoding = 'UTF8';
>
> It fails with:
> "org.postgresql.util.PSQLException: The server's client_encoding
> parameter was changed to UTF8. The JDBC driver requires
> client_encoding
> to be UNICODE for correct operation."
>
> I consider that to be a bug. The UNICODE is an alias for UTF8.
>
> Starting from 8.2, the pg_dump exports 'UTF8'
> even when --encoding=UNICODE is used.
> See:
> $ pg_dump --version
> pg_dump (PostgreSQL) 8.2.6
> $ pg_dump --encoding=UNICODE template1 | grep client_encoding
> SET client_encoding = 'UTF8';
>
>
> The check for value.equals('UNICODE') is inside
> org/postgresql/core/v3/QueryExecutorImpl.java
>
> Thanks for the driver,
> --
> Ivo Danihelka
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: explain analyze is your friend


From: Kris Jurka <books(at)ejurka(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Ivo Danihelka <ivo(dot)danihelka(at)itonis(dot)tv>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: UTF8 should be accepted as UNICODE
Date: 2008-02-22 16:35:22
Message-ID: Pine.BSO.4.64.0802221132570.2319@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Fri, 22 Feb 2008, Dave Cramer wrote:

> But it should probably ignore your attempt, since it has no effect.
>

The problem is that there are a lot of potential aliases to check, "SET
client_encoding = 'UTF -- 8'". We could try to normalize it and then
check it, but I don't think it's worth it.

Kris Jurka