Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to set locales.conf in spanish

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT netexpress.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] How to set locales.conf in spanish
  • Date: Sat, 11 Jan 2003 21:02:53 -0600

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

Attachment: pgpmv50BgZlez.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page