Unicode support - Mailing list pgsql-odbc

From Nhan Ngo Dinh
Subject Unicode support
Date
Msg-id 5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it
Whole thread Raw
Responses Re: Unicode support
List pgsql-odbc
Greetings,

I've been searching for long time for the way to convert a Microsoft SQL
7.0 database into a database such as MySQL or PostgreSQL. The problem is
that this database contains tables with both LATIN1 characters (English,
French) and Arabic characters, so the only way to put all together is to
use an unicode charset such as UTF-8.

PostgreSQL does support unicode characters (at least the documents say
that) while MySQL doesn't. I enabled the multibyte support while compiling
sources on a Linux platform and tried some ways to transfer the original
database.

First of all, I tried using the PostgreSQL ODBC driver. I've exported the
database to Microsoft Access to better handle the situation and I've
installed the PostgreSQL ODBC driver taken from ftp.postgresql.org (version
7.01.00.09). I've transferred a sample table containing both charsets and
the result was that Arabic letters were replaced into the target PostgreSQL
database by "?" characters.

In the psqlodbc_*.log files the Arabic entries were already replaced with
quotation marks.

Then I tried many other methods, using pgAdmin II, or even trying to
synchronize the databases with a PHP script that used the freetds library
(first) or the Sybase library (then) to directly access the MSSQL database.
The imported Arabic fields were always quotation marks, because the unicode
support was not fully enabled into both sybase libraries.

The only solution that I've found is to import the database using ODBC in a
PHP script with PHP on a Windows box, converting nvarchar values (with
CONVERT in the query) into varbinary, setting the binary visualization to
hex. So I can parse that string and store unicode strings into the database.

Well, may be there is a better solution directly using the PostgreSQL ODBC
driver.
Any idea?

Thanks.

Nhan NGO DINH





pgsql-odbc by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: Re: ISA Server -> ODBC -> PostgreSQL Problem
Next
From: Benoit Menendez
Date:
Subject: Problem with ODBC driver and MSP 2002