[unixODBC-support] Unicode

Nick Gorham nick at lurcher.org
Wed Jul 10 08:09:11 BST 2013


On 10/07/13 00:33, FAU wrote:
> Hello,
> I'm reading about (unix)ODBC and in particular I'm trying to sort out
> how the unicode part works.
>
> Lets say your database back-end is using UTF-8 (I believe that is what
> Postgres uses for unicode).  Do I have to call the ANSI functions in
> this case?

Yes,

> Lets say you use the wide function versions and your database back-end
> uses UTF-8 does the DM automatically convert to from UCS-2 (or UTF-16)?
if you use iconv and select the correct char sets when building the DM 
to go from UCS-2 and UTF-8. But if the database driver also exports the 
W functions they will be passed unchanged.
>
> In general does the DM wide API expects data to be in UCS-2?

Yes, As in most cases the goal is to match the Windows version. The key 
is the W functions are Wide, so 16 bit. If you read the X-Open version 
of the spec, there is no W API, single and multi byte character sets are 
intended to go via the standard (not W) API.
>
> Sorry lots of questions...

No worries.

-- 
Nick


More information about the unixODBC-support mailing list