Unicode support problem

From: "Jatinder Sangha" <js(at)coalitiondev(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Unicode support problem
Date: 2005-02-24 16:32:06
Message-ID: BCE42FB579A9854BA371EEAF4A6A6E30021EEF@coalitiondev-sv.CoalitionDev.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'm having a problem with unicode support in postgres under linux.

The issue is that I am copying lots of data from an MS SQL Server
database via java/jdbc running on Windows XP over to a postgres database
running on linux. I've setup the postgres database as follows:

LANG=C
initdb -E UNICODE
createdb -E UNICODE

And then when I'm transferring the data, when my program tries to send a
string containing a character 0xF6 (Latin small letter o with
diaeresis), then I get a JDBC exception & an error log on the server as
follows:
ERROR: invalid multibyte character for locale
HINT: The server's LC_CTYPE locale is probably incompatible with the
database encoding.

I have tried setting locale/lc_ctype to C, POSIX, iso_8859_1, all kinds
of things, and nothing seems to fix it.

If I setup the database as follows:
LANG=C
initdb -E iso8859_1
createdb -E iso8859_1

Then it appears to work OK - but I then get an error with character 0xE2
(Latin small letter a with circumflex):
ERROR: could not convert UTF-8 character 0x00e2 to ISO8859-1

Does anyone know how to do correctly do this?

This is my environment:
LINUX: DEBIAN 3.0, KERNEL 2.4 running on a 2CPU PC.
Postgres: 8.0.1 built from source, no changes to anything, running on
the linux box.
JDBC driver: postgresql-8.0-310.jdbc3.jar
Java JVM (Sun) 1.4.2_02 on Windows XP SP2.

If I run postgres on the Windows XP machine (configured for UNICODE as
above), then I don't have any errors at all. This only happens on the
linux box.

Any help in fixing this would be greatly appreciated.
Thanks,
--Jatinder Sangha
Coalition Development

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-02-24 17:06:10 Re: Questions regarding notify processing.
Previous Message Alexis Vasquez 2005-02-24 16:31:01 Unsuscribe