Re: [JDBC] Conversion between UNICODE and LATIN1 is not supported

From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: Dries Verachtert <dries(at)ulyssis(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [JDBC] Conversion between UNICODE and LATIN1 is not supported
Date: 2002-12-19 15:22:32
Message-ID: 200212191622.32306.andreak@officenet.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 19 December 2002 16:09, you wrote:
> Hello,
>
> Do you have other databases that work with UNICODE? You can check the
> encoding of all your databases with 'psql -l'. You can check if you can
> create any unicode databases with 'createdb -E UNICODE mytestdatabase'.
>
> I didn't use postgresql on solaris yet, so the following is just a
> guess: maybe you need to install additional solaris packages. For
> example to get tomcat/java working with utf-8/unicode/.. instead of
> plain ascii, we need at least the following on our systems:
>
> SUNWloc System Localization
> SUNWlocx System Localization (64-bit)
> SUNWeuluf UTF-8 L10N For Language Environment User Files
> SUNWeulux UTF-8 L10N For Language Environment User Files (64-bit)

No, all our databases are LATIN1, it's the JDBC driver which want to "set
client_encoding = 'UNICODE'". I havn't tried to connect to a UNICODE (-E
UNICODE) database with the JDBC driver.

I now created a test database <andreak> with -E UNICODE
Here is some output:

[andreak(at)www2] ~$ uname -a
SunOS www2.java.no 5.8 Generic_108528-16 sun4u sparc SUNW,Ultra-250
[andreak(at)www2] ~$ psql -l
List of databases
Name | Owner | Encoding
- -----------+----------+-----------
andreak | andreak | UNICODE
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
www | onp | LATIN1
(4 rows)

[andreak(at)www2] ~$ psql andreak
Welcome to psql 7.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

andreak=# select version();
version
- -----------------------------------------------------------------------
PostgreSQL 7.3 on sparc-sun-solaris2.8, compiled by GCC gcc (GCC) 3.2
(1 row)

andreak=# show client_encoding ;
client_encoding
- -----------------
UNICODE
(1 row)

andreak=# set client_encoding = 'LATIN1';
ERROR: Conversion between LATIN1 and UNICODE is not supported
andreak=# set client_encoding = 'UNICODE';
SET
andreak=# \q
[andreak(at)www2] ~$ psql www
Welcome to psql 7.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

www=# set client_encoding = 'LATIN1';
SET
www=# set client_encoding = 'UNICODE';
ERROR: Conversion between UNICODE and LATIN1 is not supported
www=#

This works fine on Linux, I havn't tried to patch Solaris with l10n-stuff yet,
but it would be nice to get some feedback and understand why this is
happening and why I don't get a more descriptive error. For some reason none
of the conversions work at all, except, of course, conversion between similar
encodings like UNICODE<->UNICODE.

- --
Andreas Joseph Krogh <andreak(at)officenet(dot)no>
There will always be someone who agrees with you
but is, inexplicably, a moron.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+AeQ4UopImDh2gfQRAuRvAKCbk4pyp7CbXiA4NGq8ntKpZ2IriwCeKcaC
/pPGUgPzEuzDmIdX3shR8Ps=
=EYP3
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-12-19 17:03:47 Re: link to latest on ftp-site
Previous Message Dries Verachtert 2002-12-19 15:09:13 Re: Conversion between UNICODE and LATIN1 is not supported

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-12-19 18:20:40 Re: error when using move, any suggestions?
Previous Message Dries Verachtert 2002-12-19 15:09:13 Re: Conversion between UNICODE and LATIN1 is not supported