[freetds] How to set tsql's client character set

Lowden, James K james.k.lowden at alliancebernstein.com
Thu Aug 10 12:04:36 EDT 2006


> From: KJ
> Sent: Thursday, August 10, 2006 10:52 AM
> 
> Fortunately, the code has been compiled with debug information.
> So I debugged into the code and found the corresponding part:
> 
> it's in file config.c line 485 (function tds_config_login).
...
> The point is, that connection->client_charset is "ISO-8859-1" -
> resulting from conf file, while login->client_charset is set to
> result of nl_langinfo(CODESET), which returns USASCII.  Hence it
> always will be USASCII, no matter which value is being specified
> in the config file.
> 
> May be the login structure should be filled from the config file?!

Nice work!  

The goal is to make it unnecessary to declare the client charset in
freetds.conf for a correctly configured machine.  That is, we want to
rely on the locale settings unless overridden by freetds.conf.  

Steve Langasek submitted a patch for 0.64 to do that but it was late in
the release cycle.  I eventually decided to defer it because there are a
lot of permuations and I wanted to look at it more closely.  :-(  

Please see the ML thread (subject "charset selection") starting April 1
2006.  You'll see Steve's patch and our discussion.  Have a look at it
and test it out if you like.  If you confirm it does what you want (and
what I described above), that would encourage me to apply it.  

Regards, 

--jkl

-----------------------------------------
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, any review, dissemination,
distribution or duplication of this communication is strictly prohibited. If you are
not the intended recipient, please contact the sender immediately by reply e-mail
and destroy all copies of the original message. Please note that we do not accept
account orders and/or instructions by e-mail, and therefore will not be responsible
for carrying out such orders and/or instructions.  If you, as the intended recipient
of this message, the purpose of which is to inform and update our clients, prospects
and consultants of developments relating to our services and products, would not
like to receive further e-mail correspondence from the sender, please "reply" to the
sender indicating your wishes.  In the U.S.: 1345 Avenue of the Americas, New York,
NY 10105.



More information about the FreeTDS mailing list