OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man7 / locale.7
index bb53e20..cd2246b 100644 (file)
@@ -1,5 +1,7 @@
 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\" and Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith <faith@cs.unc.edu>
 .\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein
 .\"   <jochen.hein@delphi.central.de>
 .\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible <bruno@clisp.org>
 .\"
-.TH LOCALE 7  2008-12-05 "Linux" "Linux Programmer's Manual"
+.\" FIXME Document LOCPATH;
+.\" see http://sourceware.org/bugzilla/show_bug.cgi?id=174
+.\"    Is removed for SUID/SGID programs (see sysdeps/generic/unsecvars.h)
+.TH LOCALE 7  2014-03-18 "Linux" "Linux Programmer's Manual"
 .SH NAME
-locale \- Description of multilanguage support
+locale \- description of multilanguage support
 .SH SYNOPSIS
 .nf
 .B #include <locale.h>
@@ -36,7 +42,7 @@ locale \- Description of multilanguage support
 A locale is a set of language and cultural rules.
 These cover aspects
 such as language for messages, different character sets, lexicographic
-conventions, etc.
+conventions, and so on.
 A program needs to be able to determine its locale
 and act accordingly to be portable to different cultures.
 .PP
@@ -51,13 +57,30 @@ to set the current locale, and
 .BR localeconv (3)
 to get information about number formatting.
 .PP
-There are different categories for local information a program might
+There are different categories for locale information a program might
 need; they are declared as macros.
 Using them as the first argument
 to the
 .BR setlocale (3)
 function, it is possible to set one of these to the desired locale:
 .TP
+.BR LC_ADDRESS " (GNU extension, since glibc 2.2)"
+.\" See ISO/IEC Technical Report 14652
+Change settings that describe the formats (e.g., postal addresses)
+used to describe locations and geography-related items.
+Applications that need this information can use
+.BR nl_langinfo (3)
+to retrieve nonstandard elements, such as
+.B _NL_ADDRESS_COUNTRY_NAME
+(country name, in the language of the locale)
+and
+.B _NL_ADDRESS_LANG_NAME
+(language name, in the language of the locale),
+which return strings such as "Deutschland" and "Deutsch"
+(for German-language locales).
+(Other element names are listed in
+.IR <langinfo.h> .)
+.TP
 .B LC_COLLATE
 This is used to change the behavior of the functions
 .BR strcoll (3)
@@ -78,8 +101,24 @@ and the multibyte character functions such as
 or
 .BR wctomb (3).
 .TP
+.BR LC_IDENTIFICATION " (GNU extension, since glibc 2.2)"
+.\" See ISO/IEC Technical Report 14652
+Change settings that relate to the metadata for the locale.
+Applications that need this information can use
+.BR nl_langinfo (3)
+to retrieve nonstandard elements, such as
+.B _NL_IDENTIFICATION_TITLE
+(title of this locale document)
+and
+.B _NL_IDENTIFICATION_TERRITORY
+(geographical territory to which this locale document applies),
+which might return strings such as "English locale for the USA"
+and "USA".
+(Other element names are listed in
+.IR <langinfo.h> .)
+.TP
 .B LC_MONETARY
-changes the information returned by
+This changes the information returned by
 .BR localeconv (3)
 which describes the way numbers are usually printed, with details such
 as decimal point versus decimal comma.
@@ -88,14 +127,14 @@ used by the function
 .BR strfmon (3).
 .TP
 .B LC_MESSAGES
-changes the language messages are displayed in and what an affirmative or
+This changes the language messages are displayed in and what an affirmative or
 negative answer looks like.
 The GNU C-library contains the
 .BR gettext (3),
 .BR ngettext (3),
 and
 .BR rpmatch (3)
-functions to ease the use of these information.
+functions to ease the use of this information.
 The GNU gettext family of
 functions also obey the environment variable
 .BR LANGUAGE
@@ -103,18 +142,70 @@ functions also obey the environment variable
 if the category is set to a valid locale other than
 .BR """C""" .
 .TP
+.BR LC_MEASUREMENT " (GNU extension, since glibc 2.2)"
+Change the settings relating to the measurement system in the locale
+(i.e., metric versus US customary units).
+Applications can use
+.BR nl_langinfo (3)
+to retrieve the nonstandard
+.B _NL_MEASUREMENT_MEASUREMENT
+element, which returns a pointer to a character
+that has the value 1 (metric) or 2 (US customary units).
+.TP
+.BR LC_NAME " (GNU extension, since glibc 2.2)"
+.\" See ISO/IEC Technical Report 14652
+Change settings that describe the formats used to address persons.
+Applications that need this information can use
+.BR nl_langinfo (3)
+to retrieve nonstandard elements, such as
+.B _NL_NAME_NAME_MR
+(general salutation for men)
+and
+.B _NL_NAME_NAME_MS
+(general salutation for women)
+elements, which return strings such as "Herr" and "Frau"
+(for German-language locales).
+(Other element names are listed in
+.IR <langinfo.h> .)
+.TP
 .B LC_NUMERIC
-changes the information used by the
+This changes the information used by the
 .BR printf (3)
 and
 .BR scanf (3)
-family of functions, when they are advised to use the locale-settings.
+family of functions, when they are advised to use the locale settings.
 This information can also be read with the
 .BR localeconv (3)
 function.
 .TP
+.BR LC_PAPER " (GNU extension, since glibc 2.2)"
+.\" See ISO/IEC Technical Report 14652
+Change the settings relating to the dimensions of the standard paper size
+(e.g., US letter versus A4).
+Applications that need the dimensions can obtain them by using
+.BR nl_langinfo (3)
+to retrieve the nonstandard
+.B _NL_PAPER_WIDTH
+and
+.B _NL_PAPER_HEIGHT
+elements, which return
+.I int
+values specifying the dimensions in millimeters.
+.TP
+.BR LC_TELEPHONE " (GNU extension, since glibc 2.2)"
+.\" See ISO/IEC Technical Report 14652
+Change settings that describe the formats to be used with telephone services.
+Applications that need this information can use
+.BR nl_langinfo (3)
+to retrieve nonstandard elements, such as
+.B _NL_TELEPHONE_INT_PREFIX
+(international prefix used to call numbers in this locale),
+which returns a string such as "49" (for Germany).
+(Other element names are listed in
+.IR <langinfo.h> .)
+.TP
 .B LC_TIME
-changes the behavior of the
+This changes the behavior of the
 .BR strftime (3)
 function to display the current time in a locally acceptable form; for
 example, most of Europe uses a 24-hour clock versus the
@@ -122,13 +213,10 @@ example, most of Europe uses a 24-hour clock versus the
 .TP
 .B LC_ALL
 All of the above.
-.\" FIXME glibc 2.2.2 added new nonstandard locale categories:
-.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME,
-.\" LC_PAPER, LC_TELEPHONE.  These need to be documented.
 .PP
 If the second argument to
 .BR setlocale (3)
-is empty string,
+is an empty string,
 .BR """""" ,
 for the default locale, it is determined using the following steps:
 .IP 1.
@@ -201,15 +289,39 @@ struct lconv {
 };
 .fi
 .in
-.SH "CONFORMING TO"
-POSIX.1-2001.
+.SS POSIX.1-2008 extensions to the locale API
+POSIX.1-2008 standardized a number of extensions to the locale API,
+based on implementations that first appeared in version 2.3
+of the GNU C library.
+These extensions are designed to address the problem that
+the traditional locale APIs do not mix well with multithreaded applications
+and with applications that must deal with multiple locales.
 
-The GNU gettext functions are specified in LI18NUX2000.
-.SH "SEE ALSO"
+The extensions take the form of new functions for creating and
+manipulating locale objects
+.RB ( newlocale (3),
+.BR freelocale (3),
+.BR duplocale (3),
+and
+.BR uselocale (3))
+and various new library functions with the suffix "_l" (e.g.,
+.BR toupper_l (3))
+that extend the traditional locale-dependent APIs (e.g.,
+.BR toupper (3))
+to allow the specification of a locale object that should apply when
+executing the function.
+.SH CONFORMING TO
+POSIX.1-2001.
+.\"
+.\" The GNU gettext functions are specified in LI18NUX2000.
+.SH SEE ALSO
 .BR locale (1),
 .BR localedef (1),
+.BR catopen (3),
 .BR gettext (3),
 .BR localeconv (3),
+.BR mbstowcs (3),
+.BR newlocale (3),
 .BR ngettext (3),
 .BR nl_langinfo (3),
 .BR rpmatch (3),
@@ -217,4 +329,15 @@ The GNU gettext functions are specified in LI18NUX2000.
 .BR strcoll (3),
 .BR strfmon (3),
 .BR strftime (3),
-.BR strxfrm (3)
+.BR strxfrm (3),
+.BR uselocale (3),
+.BR wcstombs (3),
+.BR locale (5)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.