[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: strange behaviour with accented chars on debian unstable
- From: Dave Dodge <dododge@...>
- Date: Mon, 7 Nov 2005 20:06:16 -0500
On Fri, Nov 04, 2005 at 11:31:40AM -0300, Walter Cruz wrote:
> Look out: I've made a little script to print all the locale environment.
> -------getenv.lua ---------
> and now:
> MCid299a:~/lua$ locale
> MCid299a:~/lua$ lua getenv.lua
I believe this is normal. The "LC_*" values that "locale" is
reporting are the locale categories themselves (as reported by
setlocale()), not environment variables. Environment variables can be
used to influence the category values, but this is optional.
For example when a program is determining the initial value for the
LC_MEASUREMENT category, it will first look for an LC_MEASUREMENT
environment variable. If none is set, it tries the LC_ALL environment
variable as a default. If that isn't set, it looks for LANG as a
further default. If all of your categories are the same, the LANG
environment variable is sufficient to initialize them.
For details, See section 8.2 of the POSIX/UNIX specification:
Note that this behavior is POSIX-specific. Standard C doesn't specify
any relationship between environment variables and the locale, so
portable scripts shouldn't rely on those variables.