Unicode support

From: Nhan Ngo Dinh <nngodinh(at)tiscali(dot)it>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Unicode support
Date: 2002-02-03 20:26:58
Message-ID: 5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Barry Lind 2002-02-07 02:19:46 Re: Case folding in DatabaseMetaData
Previous Message Hiroshi Inoue 2002-02-02 02:17:37 Re: ISA Server -> ODBC -> PostgreSQL Problem