Skip to Content.
Sympa Menu

freetds - [freetds] reading nvarchar columns in UTF-8

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Will Lowe <harpo AT thebackrow.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] reading nvarchar columns in UTF-8
  • Date: Wed, 28 Jan 2004 00:32:43 -0800

I'm using FreeTDS 0.62.1 and DBD::Sybase 1.02 on a box running Debian
unstable (sid) Linux trying to talk to M$ SQL 2k with whatever patches
the Windows Critical Update thing thinks are current.

I have some a nvarchar columns on the SQL Server side and I'd like to
read them in a perl application on the Linux box. After reading the
stuff at http://www.freetds.org/userguide/aboutunicode.htm, I set
"client charset = UTF-8" and "tds version = 8.0" in freetds.conf
... but I'm getting a lot of messages like this:

Message String: WARNING! Some character(s) could not be converted into
client's character set. Unconverted bytes were changed to question
marks ('?').

I'm not sure how this can be, since I'm pretty sure UTF-8 should be
able to represent any character that can be represented in UCS-2.

I enabled debugging in freetds.conf and I see this at the start of the
log:

Starting log file for FreeTDS 0.62.1
on 2004-01-27 23:32:00 with debug level 99.
names for ISO-8859-1: ISO-8859-1
names for UTF-8: UTF-8
names for UCS-2LE: UCS-2LE
names for UCS-2BE: UCS-2BE
iconv to convert client-side data to the "UTF-8" character set
23:32:00.242427 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
23:32:00.242922 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"

Does that last bit mean that FreeTDS is converting data from the
server to ISO-8859-1 instead of UTF-8? And if so how do I get it to
use UTF-8 instead?

Anybode know what's going on here?

--
thanks,

Will




Archive powered by MHonArc 2.6.24.

Top of Page