Lines Matching refs:locale

14 internationalization works by means of @dfn{locales}.  Each locale
16 The user chooses a set of conventions by specifying a locale (via
19 All programs inherit the chosen locale as part of their environment.
20 Provided the programs are written to obey the choice of locale, they
25 locale.
26 * Choosing Locale:: How the user specifies a locale.
28 select a locale.
29 * Setting the Locale:: How a program specifies the locale
32 * Locale Names:: Format of system-specific locale names.
33 * Locale Information:: How to access the information for the locale.
35 * Yes-or-No Questions:: Check a Response against the locale.
41 Each locale specifies conventions for several purposes, including the
77 Some aspects of adapting to the specified locale are handled
79 needs to do in order to use the collating sequence of the chosen locale
90 locale. The effects of the current locale on specific library functions
96 The simplest way for the user to choose a locale is to set the
97 environment variable @code{LANG}. This specifies a single locale to use
99 locale named @samp{espana-castellano} to use the standard conventions of
103 using, and so do their names, except that the standard locale called
106 In order to force the system to always use the default locale, the
114 For example, the user might specify the locale @samp{espana-castellano}
115 for most purposes, but specify the locale @samp{usa-english} for
122 which locales apply. However, the user can choose to use each locale
128 @cindex locale categories
131 that a user or a program can choose the locale for each category
137 argument to @code{setlocale}) has to be a valid locale name.
142 @standards{ISO, locale.h}
147 @standards{ISO, locale.h}
153 @standards{ISO, locale.h}
157 @standards{ISO, locale.h}
162 @standards{ISO, locale.h}
167 @standards{XOPEN, locale.h}
174 @standards{ISO, locale.h}
176 with @code{setlocale} to set a single locale for all purposes. Setting
181 @standards{ISO, locale.h}
182 If this environment variable is defined, its value specifies the locale
189 example, it should be possible to specify more than one locale name.
200 A C program inherits its locale environment variables when it starts up.
202 automatically control the locale used by the library functions, because
204 locale. To use the locales specified by the environment, you must call
212 to select a locale based on the user choice of the appropriate
215 @cindex changing the locale
216 @cindex locale, changing
217 You can also use @code{setlocale} to specify a particular locale, for
220 @pindex locale.h
221 The symbols in this section are defined in the header file @file{locale.h}.
223 @deftypefun {char *} setlocale (int @var{category}, const char *@var{locale})
224 @standards{ISO, locale.h}
226 @c Uses of the global locale object are unguarded in functions that
229 @c return a pointer loaded from the global locale object after releasing
245 @c isalnum_l ok (C locale)
246 @c isdigit_l ok (C locale)
248 @c tolower_l ok (C locale)
273 @c isspace ok (locale mutex is locked)
325 @c isspace_l ok (C locale)
327 @c isspace_l ok (C locale)
328 @c toupper_l ok (C locale)
331 @c isspace_l ok (C locale)
332 @c toupper_l ok (C locale)
333 @c strtol ok (@mtslocale but we hold the locale lock)
354 @c strcasecmp_l ok (C locale)
355 The function @code{setlocale} sets the current locale for category
356 @var{category} to @var{locale}.
358 If @var{category} is @code{LC_ALL}, this specifies the locale for all
362 You can also use this function to find out the current locale by passing
363 a null pointer as the @var{locale} argument. In this case,
364 @code{setlocale} returns a string that is the name of the locale
377 is passed in as @var{locale} parameter.
379 When you read the current locale for category @code{LC_ALL}, the value
381 If you specify the same ``locale name'' with @code{LC_ALL} in a
383 of locale selections.
386 locale at a later time, you must make a copy of the string. It is not
389 When the @var{locale} argument is not a null pointer, the string returned
390 by @code{setlocale} reflects the newly-modified locale.
392 If you specify an empty string for @var{locale}, this means to read the
393 appropriate environment variable and use its value to select the locale
396 If a nonempty string is given for @var{locale}, then the locale of that
399 The effective locale name (either the second argument to
401 obtained from the process environment) must be a valid locale name.
404 If you specify an invalid locale name, @code{setlocale} returns a null
405 pointer and leaves the current locale unchanged.
409 temporarily switch to a new locale.
413 #include <locale.h>
424 /* @r{Get the name of the current locale.} */
432 /* @r{Now change the locale and do some stuff with it.} */
436 /* @r{Restore the original locale.} */
443 locale categories, and future versions of the library will do so. For
445 defined in @file{locale.h}.
450 The only locale names you can count on finding on all operating systems
455 This is the standard C locale. The attributes and behavior it provides
457 initially uses this locale by default.
460 This is the standard POSIX locale. Currently, it is an alias for the
461 standard C locale.
464 The empty name says to select a locale based on environment variables.
475 If your program needs to use something other than the @samp{C} locale,
476 it will be more portable if you use whatever locale the user specifies
478 locale explicitly by name. Remember, different machines might have
487 @pindex locale
489 locale -a
493 locale names @samp{C} and @samp{POSIX}, locale names are
496 Most locale names follow XPG syntax and consist of up to four parts:
503 full specified locale is not found, less specific ones are looked for.
517 For example, the locale name @samp{de_AT.iso885915@@euro} denotes a
518 German-language locale for use in Austria, using the ISO-8859-15
521 In addition to locale names which follow XPG syntax, systems may
525 If the locale name starts with a slash @samp{/}, it is treated as a
526 path relative to the configured locale directories; see @code{LOCPATH}
530 @strong{Portability Note:} POSIX suggests that if a locale name starts
533 in @code{LOCPATH} (or the default locale directory if @code{LOCPATH}
539 As a special case, locale names used with @code{LC_ALL} can combine
540 several locales, reflecting different locale settings for different
541 categories. For example, you might want to use a U.S. locale with ISO
544 @code{LC_ALL}-style combined locale name is
553 The path used for finding locale data can be set using the
555 directories in which to search for locale definitions, separated by a
558 The default path for finding locale data is system specific. A typical
562 /usr/share/locale
571 There are several ways to access locale information. The simplest
573 functions in this library implicitly access the locale data, and use
574 what information is provided by the currently selected locale. This is
575 how the locale model is meant to work normally.
584 name of the locale currently selected by @code{LC_TIME}. This is an
591 information in the locale directly. To do this the C library provides
612 according to the selected locale using this information.
613 @pindex locale.h
618 @standards{ISO, locale.h}
620 @c This function reads from multiple components of the locale object,
625 should be formatted in the current locale.
634 @standards{ISO, locale.h}
640 and the value is @code{CHAR_MAX}, it means that the current locale has
662 and monetary quantities, respectively. In the @samp{C} locale, the
671 respectively. In the @samp{C} locale, both members have a value of
702 In the standard @samp{C} locale, both @code{grouping} and
713 In the standard @samp{C} locale, both of these members have the value
716 fractional digits. (This locale also specifies the empty string for
744 The local currency symbol for the selected locale.
746 In the standard @samp{C} locale, this member has a value of @code{""}
753 The international currency symbol for the selected locale.
760 In the standard @samp{C} locale, this member has a value of @code{""}
776 In the standard @samp{C} locale, all of these members have a value of
797 In the standard @samp{C} locale, all of these members have a value of
825 In the standard @samp{C} locale, both of these members have a value of
863 @samp{C} locale.
880 locale information. The information which was meant to be available
881 in the locale (as later specified in the POSIX.1 standard) requires more
888 @c It calls _nl_langinfo_l with the current locale, which returns a
889 @c pointer into constant strings defined in locale data structures.
891 elements of the locale categories. Unlike the @code{localeconv}
908 set used in the selected locale.
977 may or may not be the same, depending on the locale.
993 represent time and date in a locale-specific way.
996 represent a date in a locale-specific way.
999 represent time in a locale-specific way.
1005 selected locale, the return value might be the same as the one for
1008 The return value represents the era used in the current locale.
1010 Most locales do not define this value. An example of a locale which
1021 The return value gives the year in the relevant era of the locale.
1025 represent dates and times in a locale-specific era-based way.
1028 represent a date in a locale-specific era-based way.
1031 represent time in a locale-specific era-based way.
1039 the locale is used instead.
1133 The return value is a locale-specific translation of the positive response
1143 The return value is a locale-specific translation of the negative response
1157 codes). If the user has not selected any locale for the
1159 @code{"C"} locale. It is therefore possible to use this function as
1167 print a given date and time in a locale-specific way. At first one
1168 might think that, since @code{strftime} internally uses the locale
1193 Now it uses the date and time format of the locale
1194 selected when the program runs. If the user selects the locale
1203 pieces of locale-specific information to format numbers and monetary
1207 locale information, making it easier for the user to format
1213 @c accessing the locale object passed to it, accesses the active
1214 @c locale through isdigit (but to_digit assumes ASCII digits only).
1243 of the current locale. By default grouping is enabled.
1247 @samp{+} is given, the locale equivalent of @math{+}/@math{-} is used. If
1250 category of the locale selected at program runtime.
1285 from the current locale (@code{frac_digits}, @code{int_frac_digits}, see
1301 Use the locale's rules for formatting an international currency value.
1303 Use the locale's rules for formatting a national currency value.
1325 which uses the USA locale (@code{en_US}). The simplest
1342 @code{en_US} locale is a comma. The number is also rounded.
1344 precision and the default value in the locale is @math{2}. Finally,
1423 access to the corresponding locale definitions.
1434 @code{LC_MESSAGES} category of the currently selected locale. The