[freetds] How to set locales.conf in spanish

Steve Langasek vorlon at netexpress.net
Sat Jan 11 21:02:53 EST 2003


On Sat, Jan 11, 2003 at 05:00:44PM -0500, James K. Lowden wrote:

> Sounds good to me, as far as it goes.  Questions:

> 1.  How standard are the outputs from "nl_langinfo(CODESET)"?  tsql makes
> this call and prints the output when it initializes.  On NetBSD, I get
> "iso_1", which doesn't match what libiconv would want, for instance.  I
> think the answer is "not very": 
> http://www.abisource.com/lxr/source/libiconv/libcharset/lib/config.charset

Yes, it seems likely to me that there'll still be a need to map between
platform-specific charset names and canonical ones.  However, this is
something that can be done deterministically without bothering the user
to set up a config file, whereas the mapping between a locale name and a
charset, even using canonical names, may be different on different
machines.

> 2.  Where do we get the language from?  Don't we still have to parse and
> interpret setlocale(3)?  

I don't think nl_langinfo() is any help for that, but turning 'en' into
'english' or 'en_US' into 'us_english' is less troublesome than turning
any of the above into 'ISO8859-1' (vs. 'CP1252', 'ASCII', 'UTF-8',
or...).

However, nl_langinfo(D_T_FMT) looks promising for getting date formats
into the local standard by default.

> Thanks for the research, Steve.  Are we reaching agreement?  

I think so. :)

-- 
Steve Langasek
postmodern programmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20030111/74825125/attachment.bin


More information about the FreeTDS mailing list