Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • 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?
  • Date: Thu, 24 Jul 2008 18:11:56 +0200

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




Archive powered by MHonArc 2.6.24.

Top of Page