Continuing encoding fun....

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: <pgsql-odbc(at)postgresql(dot)org>
Cc: "Hiroshi Saito" <saito(at)inetrt(dot)skcapi(dot)co(dot)jp>, "Marko Ristola" <Marko(dot)Ristola(at)kolumbus(dot)fi>, "Johann Zuschlag" <zuschlag2(at)online(dot)de>
Subject: Continuing encoding fun....
Date: 2005-09-03 19:47:38
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9E4A@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

I've been thinking about this whilst getting dragged round the shops
today, and having read Marko's, Johann's, Hiroshi's and other emails,
not to mention bits of the ODBC spec, here's where I think we stand.

1) The current driver works as expected with Unicode apps.

2) 7 bit ASCII apps work correctly. The driver manager maps the ANSI
functions to the Unicode ones, and because (as I think Marko pointed
out) the basic latin chars map directly into the lower Unicode
characters (see http://www.unicode.org/charts/PDF/U0000.pdf).

3) Some other single byte LATIN encodings do not work. This is because
the characters do not map directly into Unicode 80-FF
(http://www.unicode.org/charts/PDF/U0080.pdf).

4) Multibyte apps do not work. I believe that in fact they never will
with a Unicode driver, because multibyte characters simply won't map
into Unicode in the same way that ASCII does. The user cannot opt to use
the non-wide functions, because the DM automatically maps them to the
Unicode versions.

Because the Driver Manager forces the user to use the *W functions if
they exist, I cannot see any way to make 3 or 4 work with a Unicode
driver. If we were to try to detect what encoding to use based on the OS
settings and convert on the fly, we would most likely break any apps
that try to do the right thing by using Unicode themselves. Does that
sound reasonable?

Therefore, it seems to me that the only thing to do is to reinstate the
#ifdef UNICODE preprocessor definitions in the source code (that I now
with I hadn't removed!), and ship 2 versions of the driver - a Unicode
one, and an ANSI/Multibyte version (ie. What 07.xx was).

Thoughts/comments? Hiroshi, what do other vendors do for the Japanese
market?

Regards, Dave.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Matthias Weinert 2005-09-04 14:22:49 limit & offset
Previous Message Marko Ristola 2005-09-03 13:14:54 Re: savepoint