Re: Force use of UTF-8 instead of ISO8859-1

[email protected]
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Thu, Jan 28, 2010 at 08:44:43PM +0100, Frediano Ziglio wrote:
> 2010/1/28 Michael Mata <[email protected]>:
> > On Wed, Jan 27, 2010 at 11:14 PM, Michael Mata <[email protected]>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
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.