[Linux manuál]
Návod, kniha: Linux Programmer's Manual
setlocale: nastavit aktuální národní prostředí
Originální popis anglicky: setlocale - set the current localeNávod, kniha: Linux Programmer's Manual
STRUČNĚ
#include <locale.h>char *setlocale(int category, const char *locale);
POPIS / INSTRUKCE
The setlocale() function is used to set or query the program's current locale. If locale is not NULL, the program's current locale is modified according to the arguments. The argument category determines which parts of the program's current locale should be modified.- LC_ALL
- for all of the locale.
- LC_COLLATE
- for regular expression matching (it determines the meaning of range expressions and equivalence classes) and string collation.
- LC_CTYPE
- for regular expression matching, character classification, conversion, case-sensitive comparison, and wide character functions.
- LC_MESSAGES
- for localizable natural-language messages.
- LC_MONETARY
- for monetary formatting.
- LC_NUMERIC
- for number formatting (such as the decimal point and the thousands separator).
- LC_TIME
- for time and date formatting.
NÁVRATOVÁ HODNOTA
A successful call to setlocale() returns an opaque string that corresponds to the locale set. This string may be allocated in static storage. The string returned is such that a subsequent call with that string and its associated category will restore that part of the process's locale. The return value is NULL if the request cannot be honored.ODPOVÍDAJÍCÍ
ANSI C, POSIX.1NOTES
Linux (that is, GNU libc) supports the portable locales "C" and "POSIX". In the good old days there used to be support for the European Latin-1 "ISO-8859-1" locale (e.g. in libc-4.5.21 and libc-4.6.27), and the Russian "KOI-8" (more precisely, "koi-8r") locale (e.g. in libc-4.6.27), so that having an environment variable LC_CTYPE=ISO-8859-1 sufficed to make isprint() return the right answer. These days non-English speaking Europeans have to work a bit harder, and must install actual locale files.SOUVISEJÍCÍ
locale(1), localedef(1), isalpha(3), localeconv(3), strcoll(3), strftime(3), charsets(4), locale(7)| 1999-07-04 | GNU |