From: Hiroshi Inoue <inoue@tpf.co.jp>
To: FAU <fau@email.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: UNICODE
Date: Thu, 11 Jul 2013 01:12:45 +0900
Message-ID: <51DD87FD.1010600@tpf.co.jp> (raw)
In-Reply-To: <1373429843.2145.7.camel@elitebook>
References: <1373387342.977.12.camel@elitebook>
<51DCD4A7.4070404@tpf.co.jp>
<1373429843.2145.7.camel@elitebook>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
(2013/07/10 13:17), FAU wrote:
> On Wed, 2013-07-10 at 12:27 +0900, Inoue, Hiroshi wrote:
>> Hi,
>>
>> (2013/07/10 1:29), FAU wrote:
>>> Hello,
>>>
>>> I'm trying to understand how (unix)ODBC and psqlodbc work together
>>> regarding UNICODE.
>>>
>>> So from what I understand is that ODBC UNICODE is/was inherently
>>> UCS-2LE.
>>
>> Currently UTF-16LE or UTF-16BE according to the endianness of the
>> machine.
>>
>>> Does the UNICODE driver version (which is psqlodbcw.so I
>>> assume) expect/send UCS-2LE or (as I read somewhere) UTF-8, or does it
>>> expect/send whatever the back-end database is setup to?
>>
>> The unicode driver expects UTF-16 not UTF-8.
>> If you are to pass/accept UTF-8 string parameters, use the ANSI
>> version of the driver and set client_encoding to 'UTF-8'.
>
> What if the back end database is not setup to unicode (e.g. 8859-1 or
> whatever) and the odbc client decides to use the wide/utf-16 API
> does this work out for the client?
Yes as long as the client passes valid strings for the database.
> If it does then this would mean that
> there would be some conversion along the path (either done by the driver
> manager, the driver or the database).
Yes the driver does the conversion between UTF-16 and UTF-8 and
the PG database does the conversion between UTF-8 and the database
encoding. Though the PG database provides the conversion functionality
between the client encoding and the server encoding, it doesn't
support UTF-16 unfortunately.
regards,
Hiroshi INoue
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
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: inoue@tpf.co.jp, fau@email.com
Subject: Re: UNICODE
In-Reply-To: <51DD87FD.1010600@tpf.co.jp>
References: <1373387342.977.12.camel@elitebook> <51DCD4A7.4070404@tpf.co.jp> <1373429843.2145.7.camel@elitebook> <51DD87FD.1010600@tpf.co.jp>
* 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