Steven T. Hatton wrote:
Do you happen to know what determines how these locale settings
affect the
behavior of the OS, and programs? That is, what files and components are
involved in defining the encodings? What actually changes when the values of
the variables are modified? These are the variables in question:
Tue Oct 22 03:42:12:> locale
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE=POSIX
LC_MONETARY="POSIX"
LC_ALL=
The above are all specified by ANSI C.
LC_MESSAGES="POSIX"
LANG=POSIX
These aren't specified by ANSI C, but are part of POSIX or similar
Unix standards.
Apart from LC_MESSAGES, these variables affect a number of ANSI C
functions. The following is from a draft of the C9X standard (although
it's basically unchanged since C89).
[#2] The setlocale function selects the appropriate portion
of the program's locale as specified by the category and
locale arguments. The setlocale function may be used to
change or query the program's entire current locale or
portions thereof. The value LC_ALL for category names the
program's entire locale; the other values for category name
only a portion of the program's locale. LC_COLLATE affects
the behavior of the strcoll and strxfrm functions. LC_CTYPE
affects the behavior of the character handling functions174)
and the multibyte and wide-character functions. LC_MONETARY
affects the monetary formatting information returned by the
localeconv function. LC_NUMERIC affects the decimal-point
character for the formatted input/output functions and the
string conversion functions, as well as the nonmonetary
formatting information returned by the localeconv function.
LC_TIME affects the behavior of the strftime and strfxtime
functions.
LC_MESSAGES is used by gettext() etc to select a message catalogue.
However, note that libc uses gettext() internally (e.g. for error
messages), so it may affect programs which don't explicitly use
gettext().
However:
1. Most of these variables only have an effect if the program calls
setlocale() with an empty string as the second argument; otherwise,
the program behaves as if the "C" (or "POSIX") locale was selected.
Also, a program may use some variables while ignoring others; E.g.
using LC_NUMERIC complicates matters if the program needs to write
floating-point numbers to network streams or files which will be read
by programs which assume that the decimal separator is a dot (aka
period, full-stop).
2. If LC_ALL is set, it overrides the settings of all of the other
LC_* variables. OTOH, the value of LANG is used as a default for any
categories for which the appropriate LC_* variable is unset.
More details may be available from the manual pages for the relevant
functions, the "libc" Info file, and various standards documents.
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
I have never heard of these.
--
Glynn Clements <glynn.clements(a)virgin.net>