pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nhan Ngo Dinh <nngodinh@tiscali.it>
To: pgsql-odbc@postgresql.org
Subject: Unicode support
Date: Sun, 03 Feb 2002 21:26:58 +0100
Message-ID: <5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it> (raw)

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







view thread (32+ messages)  latest in thread

Message-ID: <5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it>
Permalink:  ../5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it/
Also on:    postgresql.org/message-id/5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: nngodinh@tiscali.it
  Subject: Re: Unicode support
  In-Reply-To: <5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it>
  References: <5.1.0.14.0.20020203205617.009d1200@pop.tiscalinet.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox