[freetds] FreeTDS and UTF-8 support - What is UNICODE?
ikorot at earthlink.net
Thu Jul 24 13:08:21 EDT 2008
>From: Sebastien FLAESCH <sf at 4js.com>
>Sent: Jul 24, 2008 9:11 AM
>To: Igor Korot <ikorot at earthlink.net>, FreeTDS Development Group <freetds at lists.ibiblio.org>
>Subject: Re: [freetds] FreeTDS and UTF-8 support - What is UNICODE?
>Igor Korot wrote:
>>> SQLWCHAR is #define UNICODE dependent, and I think it can be wchar_t,
>>> while SQLCHAR can only be char.
>> SQLWCHAR _is_ #define UNICODE dependent (that's why it has W in it's name),
>> however it is resolving itself to be unsigned short. When I was looking at
>> the unixODBC headers, I was also confused and had to ask the maintainer.
>> The reason being (according to him) is that 'unsigned short' is 2 bytes
>> everywhere, and also because SQLWCHAR is defined as UTF-16 on Windows.
>> I don't know about SQLCHAR though. My program is UNICODE only.
>Thanks Igor ... interesting.
>If you let me make a comment about your last sentence:
>"My program is UNICODE only."
OK, let me rephrase it then:
"My program is "UNICODE" only." ;-)
>I think we should not use "UNICODE" when we talk about a character set
>(must be "UCS-2" in your case).
>UNICODE can be implemented by different character encodings, it can be
>UTF-7, UTF-8, UTF-16, UCS-2, UCS-4 ...
I totally agree with you. However, it looks like *nix is using UTF8 by default
as a "wide character" encoding. And it becoming a standard "de ure".
>I known the Windows people think UNICODE = UCS-2 / UTF-16 but that's
>a shortcut that confuses people that are new to I18N ;-)
Yes, see above.
Also, keep in mind that my comment refers to the unixODBC. I didn't check what is
going on in the iODBC package. That will be my next step, unless you want to do it/
beat me to it.
More information about the FreeTDS