[unixODBC-dev] unixODBC and Unicode?

Nick Gorham nick at easysoft.com
Thu Jul 22 12:39:14 BST 2004


Sven Köhler wrote:
> Hi,
> 
> does unixODBC support unicode-drivers? And what does unixODBC do, if an 
> non-unicode application tries to use a unicode driver?
> 
> I often use Perl and DBD-ODBC on Windows with the SAPDB Unicode ODBC 
> Driver. Perl and DBD-ODBC aren't Unicode aware yet, afaik. Since all 
> german umlauts etc. are correct, i guess that the driver manager 
> translates all unicode-strings to the current locale.
> 
> Does unixODBC also do this translation? and does it support UCS2? The 
> SAPDB developers told me, that their ODBC driver does use UCS2 even on 
> UNIX which seems to use UCS4 for unicode characters.
> 
> Thx
>   Sven

Hi,

The driver manager by default will match what the windows DM does. If 
the driver supports the W functions they are called directly, else the 
driver manager maps the app calling the W functions into the ansi driver 
functions. It uses UCS2 (16 bit unicode chars) If it can the driver 
manager will use iconv to convert chars, if not it just truncates the 
high 8 bits to give a 8 bit char.

As the windows spec, if the driver is unicode, the driver will call the 
unicode driver entrys converting as above.

-- 
Nick



More information about the unixODBC-dev mailing list