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: Fri, 10 Jan 2003 19:37:25 -0600

On Fri, Jan 10, 2003 at 07:27:50PM -0500, James K. Lowden wrote:

> In short, I think locales.conf has yet to be used by anyone. We can
> eliminate it now. :(

> Then we have the problems of L10N and the LANG rat's nest. It could be
> two characters, or five, or the English name of the language (eg,
> "Spanish"). It might have a charset attached to it, delimited by '.' or
> '@' or no doubt something else. Futhermore, there's no rule that LANG has
> to be populated; the same information could come from ~./login_conf or
> something.

> I would like to use setlocale(3), but ANSI standardized the signature
> while saying nothing about its inputs or outputs. It gets us a step away
> from $LANG, but only a small amount closer to knowing what character set
> and language to tell the server to use.

Is portability to all ANSI platforms a requirement? What if locale
support was limited to SUSv2 platforms? With SUSv2, you don't have to
futz with the LANG variable at all; you call setlocale(), call
nl_langinfo(), and out pops an authoritative character set name.

I'm not certain how well-supported SUSv2 is; at the very least, I find
that nl_langinfo() is supported by MacOS X, NetBSD (since 1994 it
seems), FreeBSD, Linux, AIX (4.3), and Solaris -- in short, every Unix I
looked up info on supports this method. Are there other platforms I've
overlooked that people consider it important to have locale support on?

I'm strongly in favor of using nl_langinfo(), because it's really not
FreeTDS's business to map locales to character sets: it's the OS's
responsibility to do this, and as shown, OSes appear to be living up to
this.

--
Steve Langasek
postmodern programmer

Attachment: pgp8Yy_7vE_kp.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page