Skip to Content.
Sympa Menu

freetds - [freetds] FreeTDS and SQL Server 2008 UTF-16 characters

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Burkhard AT habmalnefrage.de
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] FreeTDS and SQL Server 2008 UTF-16 characters
  • Date: Wed, 22 Sep 2010 17:12:40 +0200

Hi everybody,

Though the NCHAR data type stores unicode characters in the UCS-2 encoding (2
bytes per character), SQL Server 2008 also supports the full UTF-16 range.
For characters that are beyond the BMP (Basic Multilingual Plane) and require
more than 2 bytes, SQL Server adds surrogate characters as defiend by UTF-16.
There are limitations (e.g. the string length function doesn't work
correctly), but at least it is possible to store and retrieve such characters
in NVARCHAR columns.

FreeTDS doesn't seem to support such characters that are beyond the BMP. In
the FreeTDS dump file, I can see the UTF-16 byte sequence coming in correctly
from the SQL Server 2008, but then apparently the characters are converted
from UCS-2LE to my client character set (UTF-8). I would expect it to convert
from UTF-16 to UTF-8.

Has anybody come across the same problem, and is there any solution to it
using the current FreeTDS version? Are there any working alternatives?

Thanks in advance for any help,
Burkhard

--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail




Archive powered by MHonArc 2.6.24.

Top of Page