Bruno Jargot wrote at 01/24/07 10:26:
Which of the LC* variables is responsible to set the encoding which an
application or shell uses? I never understood why there are different
LC* variables.

Hello Bruno,

The LC_ALL has the highest priority. And then LC_* (such as LC_CTYPE
and LC_COLLATE) and then lastly LANG. This priority definition is described
at the setlocale(3C) man page.

In C/C++ and such programming, people just call setlocale(3C) to
set the locale as you know in their application. In shell, *if needed*,
checking on LC_ALL, LC_CTYPE, and then LANG would be a good idea for
figuring out the locale and its codeset. Of course, you could also
check on LC_ALL, LC_MESSAGES, and then LANG if you mainly concern about
messages assuming that people won't put incompatible locale at LC_MESSAGES.

The original idea of having multiple categories was that people could
mix up different locales as long as they are compatible in terms of codeset
such as LANG=en_US.UTF-8 and LC_COLLATE=fr_FR.UTF-8 so that I would be
able to use all American English UTF-8 but with French collation or sorting
order. Or, LANG=fr_FR.UTF-8 and LC_MESSAGES=en_US.UTF-8 or C and so on
so that multiple locales could be used to comprise an environment of
my choice.

Ienup
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to