dmi_locale_setup
Description
The dmi_locale_setup function sets up the locale of a program from the
environment in one call:
-
the
LC_CTYPEandLC_MESSAGEScategories of the C library are taken from the environment bysetlocale(3), so that characters are classified and messages of the system are written in the language of the user; -
the locale of the library is set by
dmi_set_localeto the default locale of the environment, so that printable names are translated as well, and left in English when there is no translation.
Other categories, LC_NUMERIC in particular, are deliberately left in the C
locale, so that the decimal point of formatted values does not depend on the
environment, and machine-readable output is the same everywhere.
Programs which handle the locale themselves do not need the function, and
call setlocale(3) and dmi_set_locale on their own.
In the kernel, which has no locale environment, only the locale of the library is set.
Thread safety
Like dmi_set_locale, the function is not thread-safe. It is meant to be
called once, at the start of the program, before the library is used.
See also
dmi_set_locale,
dmi_get_locale,
setlocale(3)