Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
locale(7)
Edit
PageHistory
Diff
Info
LikePages
LOCALE !!!LOCALE NAME SYNOPSIS DESCRIPTION CONFORMS TO SEE ALSO ---- !!NAME locale - Description of multi-language support !!SYNOPSIS __#include __ !!DESCRIPTION A locale is a set of language and cultural rules. These cover aspects such as language for messages, different character sets, lexigraphic conventions, etc. A program needs to be able to determine its locale and act accordingly to be portable to different cultures. The header ____ declares data types, functions and macros which are useful in this task. The functions it declares are __setlocale()__ to set the current locale, and __localeconv()__ to get information about number formatting. There are different categories for local information a program might need; they are declared as macros. Using them as the first argument to the __setlocale()__ function, it is possible to set one of these to the desired locale: __LC_COLLATE__ This is used to change the behaviour of the functions __strcoll()__ and __strxfrm()__, which are used to compare strings in the local alphabet. For example, the German sharp s is sorted as __ __LC_CTYPE__ This changes the behaviour of the character handling and classification functions, such as __isupper()__ and __toupper()__, and the multi-byte character functions such as __mblen()__ or __wctomb()__. __LC_MONETARY__ changes the information returned by __localeconv()__ which describes the way numbers are usually printed, with details such as decimal point versus decimal comma. This information is internally used by the function __strfmon()__. __LC_MESSAGES__ changes the language messages are displayed in and how an affirmative or negative answer looks like. The GNU C-library contains the __rpmatch()__ function to ease the use of these information. __LC_NUMERIC__ changes the information used by the __printf()__ and __scanf()__ family of functions, when they are advised to use the locale-settings. This information can also be read with the __localeconv()__ function. __LC_TIME__ changes the behaviour of the __strftime()__ function to display the current time in a locally acceptable form; for example, most of Europe uses a 24-hour clock vs. the US' 12-hour clock. __LC_ALL__ All of the above. If the second argument to __setlocale()__ is empty string, ____, for the default locale, it is determined using the following steps: 1. If there is a non-null environment variable __LC_ALL__, the value of __LC_ALL__ is used. 2. If an environment variable with the same name as one of the categories above exists and is non-null, its value is used for that category. 3. If there is a non-null environment variable __LANG__, the value of __LANG__ is used. Values about local numeric formatting is made available in a __struct lconv__ returned by the __localeconv()__ function, which has the following declaration: struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is ' '. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 if a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 if a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string succeeds the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately succeeds the currency_symbol. */ char p_sign_posn; char n_sign_posn; }; !!CONFORMS TO POSIX.1 !!SEE ALSO setlocale(3), localeconv(3), locale(1), localedef(1), rpmatch(3), strfmon(3), strcoll(3), strxfrm(3), strftime(3) ----
26 pages link to
locale(7)
:
Man7l
catclose(3)
catopen(3)
glob(7)
X(1)
isalnum(3)
isalpha(3)
isascii(3)
isblank(3)
iscntrl(3)
isdigit(3)
isgraph(3)
islower(3)
isprint(3)
ispunct(3)
isspace(3)
isupper(3)
isxdigit(3)
localeconv(3)
localedef(1)
nl_langinfo(3)
setlocale(3)
strfmon(3)
tolower(3)
toupper(3)
LocaleName
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.