FreeTDS and SQL Server 2008 UTF-16 characters

[email protected]
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.