[freetds] Character conversion errorwithspecialcharacters(umlauts)

Stefan Axelsson Stefan.Axelsson at ltkalmar.se
Mon Jul 21 09:39:29 EDT 2008


Sorry for double post. Sometimes you just happen to touch your laptops glidepad, and sometimes you just happen to have the cursor over "send", and sometimes those two coinside. Like...a minute ago. So again, sorry. 
 
<SNIP>

>> If I've missunderstoof you now, do tell me. I'm still quite fresh 
>> when it comes to this (old MySQL user realy), and thus I might just 
>> missunderstand a few things here and there. ;)
>> 
>> I've set the Client Charset option (both in freetds.conf and in 
>> odbc.ini to be sure) to UTF-8. Also tried a few others just to make 
>> sure, doesn't help any.
>> 
>
>Remember that in utf8 above characters are not encoded using single 
>characters

Ah, true. I can only say "duh". ;)

>> Basically this is my configs: (defaults are kept, so I'll just post 
>> the system specifics)
>> 
>> ----- /etc/freetds/freetds.conf -----
>> 
>> [CMDB]
>> 	host = anonymized.host.name.com
>> 	port = 1433
>> 	tds version = 8.0
>> 	client charset = UTF-8
>> 
>> -------------------------------------
>> 
>> 
>> ----- /etc/odbc.ini -----------------
>> 
>> [ODBC Data Sources]
>> CMDB = Microsoft SQL Server 2003
>> 
>> [CMDB]
>> Driver	= /usr/lib/libtdsodbc.so
>> Description	= CMDB Data
>> Trace		= Yes
>> TraceFile	= /tmp/cmdb_tds.log
>> Server	= anonymized.host.name.com
>> Database	= cmdb
>> TDS_Version	= 8.0
>> 
>> -------------------------------------
>> 
>
>This is odbc-only so freetds.conf should not be used. Default charset is iso8859-1 so encoding like you suggested should work.

As I thought, included it "just in case". Logs says it should use iso8859-1 (as you've presumably seen), I've set Client Charset to UTF-8, ISO8859-1 (with different takes on dash, like undescore and none (as per the output of "iconv -l")), so I belive I've got the config part covered unless I've totally missed something obvious (or very very obscure...) And because just about everything on this box is installed the "apt-get" way I feel that they're presumably tested out for Ubuntu (although, I don't count on that at 100%)

Just tested something else, as I realized I hadn't. isql lets me update the records with åäö in them just fine. Checking on the server and the updated data is as it should be. Getting the records back through isql (SELECT * FROM tablename) works fine. Using my Perl-script returns ? Where the åäö should be.

Unfortunately I'm still rather confused about what talks to what, and how. And I'm even more in the dark when it comes to how to track what happens step-by-step. All I've gotten to work so far is the logging I can enable in odbcinst.ini-file. So if you, or anyone else, have any ideas, hints, tricks...do tell. I'd so prefere to solve this and not just install some other distro/port to Windows.

Regards,
Stefan



More information about the FreeTDS mailing list