[freetds] Force use of UTF-8 instead of ISO8859-1

jklowden at schemamania.org jklowden at schemamania.org
Thu Jan 28 15:46:50 EST 2010


On Thu, Jan 28, 2010 at 08:44:43PM +0100, Frediano Ziglio wrote:
> 2010/1/28 Michael Mata <michaelvmata at gmail.com>:
> > On Wed, Jan 27, 2010 at 11:14 PM, Michael Mata <michaelvmata at gmail.com>wrote:
> > I was mistaken. I'm passing the SERVER, not SERVERNAME, in the connection
> > string. According to the docs (http://www.freetds.org/userguide/dsnless.htm),
> > this should be a DSN-less configuration that does not use freetds.conf. Is
> > there a way to set the client charset using this configuration?
> 
> Not with 0.82... support for additional attributes was added in CVS HEAD.

The default should come from the environment, though.  Why is Michael's wrong when tsql says he's using utf-8?  

Client encoding should be set in order of priority:

0.  (new environment variable)
1.  freetds.conf
2.  nl_langinfo(CODESET) // application must call setlocale(3)
3.  ISO 8859-1		// compiled-in default

In tds_get_locale() we parse the LANG environment variable, which we really shouldn't do.  

But we don't call nl_langinfo(3).  Any reason not to?  

--jkl



More information about the FreeTDS mailing list