Skip to Content.
Sympa Menu

freetds - iconv support

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: <freetds AT franklin.oit.unc.edu>
  • Subject: iconv support
  • Date: Sun, 25 Nov 2001 14:36:06 -0500 (EST)



Well, I *finally* got around to finishing off iconv support (four day
weekends are great).

It works like this:

. By default TDS 7.0 streams will have their high order byte stripped like
before.
. Support for iconv must be compiled in. (autoconf *should* pick up
whether you have it or not).
. iconv conversion needs to be turned on using the 'client charset' string
in the freetds.conf file. Users of the old interfaces file will not be
able to use iconv conversion.
. Unfortunately iconv converts unconvertable characters to null, and thus
a mismatch of SQL and iconv charset will result in a truncation at the
first unconvertable character. Solutions anyone?
. I'm a bit nervous on the multibyte support including UTF-8. I tried
UTF-8 with sqsh and got garbage characters (SQSH is not unicode clean),
but I fear if the UTF-8 strings exceed the size of the column from which
they came there could be a buffer overrun in the application. So,
please ensure your apps can handle it before using. I'm looking at what
support needs to be added in ctlib/dblib (specifically ct_describe) to
alleviate this problem. However, many apps will make assumptions based
on single character charsets, and dblib especially allow the apps to not
pass a buffer length when binding. Be careful!

Anyway, to turn it on, grab a new copy of FreeTDS from CVS, build it, and
modify your freetds.conf file like so:

[sqlserver]
tds version = 7.0
host = ntbox.localdomain.com
port = 1433
client charset = ISO-8859-1

The 'client charset' will turn on client conversion to and from the
specified charset (ISO-8859-1 in this case). To find a list of supported
character sets, run 'iconv --list' for linux, consult your documentation
for other systems (and post it here so I can update the user guide!).

I'd be especially interested to hear from folks using single character
cyrillic sets to see if this solves the problem for you guys. This seems
to be where the question comes up most often.

Oh and one last thing, jkl if your reading, where in the user guide to you
want all this documented? I updated the freetds.conf settings table, but
I'd like to do a full write up.


Enjoy,

Brian





Archive powered by MHonArc 2.6.24.

Top of Page