[freetds] FreeTDS and UTF-8 support - What is UNICODE?

Sebastien FLAESCH sf at 4js.com
Thu Jul 24 12:11:56 EDT 2008


Igor Korot wrote:
> Sebastien,
> 
>> 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."

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 known the Windows people think UNICODE = UCS-2 / UTF-16 but that's
a shortcut that confuses people that are new to I18N ;-)

http://en.wikipedia.org/wiki/UNICODE

Cheers,
Seb


More information about the FreeTDS mailing list