pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Herbert <Marc.Herbert@continuent.com>
To: pgsql-odbc@postgresql.org
Subject: Re: Continuing encoding fun....
Date: Mon, 21 Nov 2005 18:19:15 +0100
Message-ID: <87hda52a24.fsf@meije.emic.fr> (raw)
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9E4A@ratbert.vale-housing.co.uk>

"Dave Page" <dpage@vale-housing.co.uk> writes:

> 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. 


I agree that 4) can never work, because ODBC does not seem compatible
with multibyte apps by design. ODBC caters for "ANSI" and "Unicode"
strings, that's all.
<http://blogs.msdn.com/oldnewthing/archive/2004/05/31/144893.aspx;


However, I don't get why 3) does not work. From here:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcunicode_function_argum...;

 If the driver is a Unicode driver, the Driver Manager makes function
 calls as follows: 
 - Converts an ANSI function (with the A suffix) to a Unicode function
 (with the W suffix) by converting the string arguments into Unicode
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 characters and passes the Unicode function to the driver.


Are you saying in 3) that the "converting" underlined above is
actually just a static cast?!

Is this "bug" true for every driver manager out there?






view thread (24+ messages)  latest in thread

Message-ID: <87hda52a24.fsf@meije.emic.fr>
Permalink:  ../87hda52a24.fsf@meije.emic.fr/
Also on:    postgresql.org/message-id/87hda52a24.fsf@meije.emic.fr

 · 

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: Marc.Herbert@continuent.com
  Subject: Re: Continuing encoding fun....
  In-Reply-To: <87hda52a24.fsf@meije.emic.fr>
  References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9E4A@ratbert.vale-housing.co.uk> <87hda52a24.fsf@meije.emic.fr>

* 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