LinuxReviws.org --get your your Linux knowledge
> Linux Reviews > Manual Pages (man) >

locale


  1. locale.1.man
  2. locale.3.man
  3. locale.5.man
  4. locale.7.man


1. locale.1.man

Manpage of LOCALE

LOCALE

Section: Debian GNU/Linux (1)
Updated: 2002-03-02
Index Return to Main Contents
 

NAME

locale - Get locale-specific information.  

SYNOPSIS

locale [ "-a" | "-m"]

locale [ -ck ] name...  

DESCRIPTION

The locale program writes information about the current locale environment, or all locales, to standard output.

When invoked without arguments, locale summarizes the current locale environment for each locale category defined by the LC_* environment variables.

-a, --all-locales

        Write names of available locales.


-m, --charmaps

        Write names of available charmaps.


 

Output Format:

-c, --category-name

        Write names of selected categories.


-k, --keyword-name

        Write names and values of selected keywords.


 

ENVIRONMENT VARIABLES

LC_CTYPE

        Character classification and case conversion.


LC_COLLATE

        Collation order.


LC_TIME

        Date and time formats.


LC_NUMERIC

        Non-monetary numeric formats.


LC_MONETARY

        Monetary formats.


LC_MESSAGES

        Formats of informative and diagnostic messages and
        interactive responses.


LC_PAPER

        Paper size.


LC_NAME

        Name formats.


LC_ADDRESS

        Address formats and location information.


LC_TELEPHONE

        Telephone number formats.


LC_MEASUREMENT

        Measurement units (Metric or Other).


LC_IDENTIFICATION

        Metadata about the locale information.


 

AUTHOR

locale was written by Ulrich Drepper for the GNU C Library.

This manpage was written by Joel Klecker <espy@debian.org> for the Debian GNU/Linux system, and expanded by Alastair McKinstry <mckinstry@computer.org>


 

Index

NAME
SYNOPSIS
DESCRIPTION
Output Format:
ENVIRONMENT VARIABLES
AUTHOR

This document was created by man2html using the manual pages.
Time: 17:31:25 GMT, October 23, 2013

2. locale.3.man

Manpage of locale

locale

Section: Perl Programmers Reference Guide (3)
Updated: 2001-09-21
Index Return to Main Contents
 

NAME

locale - Perl pragma to use and avoid POSIX locales for built-in operations  

SYNOPSIS

    @x = sort @y;       # ASCII sorting order
    {
        use locale;
        @x = sort @y;   # Locale-defined sorting order
    }
    @x = sort @y;       # ASCII sorting order again

 

DESCRIPTION

This pragma tells the compiler to enable (or disable) the use of POSIX locales for built-in operations (LC_CTYPE for regular expressions, and LC_COLLATE for string comparison). Each ``use locale'' or ``no locale'' affects statements to the end of the enclosing BLOCK.

See perllocale for more detailed information on how Perl supports locales.


 

Index

NAME
SYNOPSIS
DESCRIPTION

This document was created by man2html using the manual pages.
Time: 17:31:25 GMT, October 23, 2013

3. locale.5.man

Manpage of LOCALE

LOCALE

Section: Linux User Manual (5)
Updated: 2008-06-17
Index Return to Main Contents
 

NAME

locale - Describes a locale definition file  

DESCRIPTION

The locale definition files contains all the information that the localedef(1) command needs to convert it into the binary locale database.

The definition files consist of sections which each describe a locale category in detail.  

Syntax

The locale definition file starts with a header that may consist of the following keywords:
<escape_char>
is followed by a character that should be used as the escape-character for the rest of the file to mark characters that should be interpreted in a special way. It defaults to the backslash (\).
<comment_char>
is followed by a character that will be used as the comment-character for the rest of the file. It defaults to the number sign (#).

The locale definition has one part for each locale category. Each part can be copied from another existing locale or can be defined from scratch. If the category should be copied, the only valid keyword in the definition is copy followed by the name of the locale which should be copied.  

LC_CTYPE

The definition for the LC_CTYPE category starts with the string LC_CTYPE in the first column.

There are the following keywords allowed:

upper
followed by a list of uppercase letters. The letters A through Z are included automatically. Characters also specified as cntrl, digit, punct, or space are not allowed.
lower
followed by a list of lowercase letters. The letters a through z are included automatically. Characters also specified as cntrl, digit, punct, or space are not allowed.
alpha
followed by a list of letters. All character specified as either upper or lower are automatically included. Characters also specified as cntrl, digit, punct, or space are not allowed.
digit
followed by the characters classified as numeric digits. Only the digits 0 through 9 are allowed. They are included by default in this class.
space
followed by a list of characters defined as white-space characters. Characters also specified as upper, lower, alpha, digit, graph, or xdigit are not allowed. The characters <space>, <form-feed>, <newline>, <carriage-return>, <tab>, and <vertical-tab> are automatically included.
cntrl
followed by a list of control characters. Characters also specified as upper, lower, alpha, digit, punct, graph, print, or xdigit are not allowed.
punct
followed by a list of punctuation characters. Characters also specified as upper, lower, alpha, digit, cntrl, xdigit, or the <space> character are not allowed.
graph
followed by a list of printable characters, not including the <space> character. The characters defined as upper, lower, alpha, digit, xdigit, and punct are automatically included. Characters also specified as cntrl are not allowed.
print
followed by a list of printable characters, including the <space> character. The characters defined as upper, lower, alpha, digit, xdigit, punct, and the <space> character are automatically included. Characters also specified as cntrl are not allowed.
xdigit
followed by a list of characters classified as hexadecimal digits. The decimal digits must be included followed by one or more set of six characters in ascending order. The following characters are included by default: 0 through 9, a through f, A through F.
blank
followed by a list of characters classified as blank. The characters <space> and <tab> are automatically included.
toupper
followed by a list of mappings from lowercase to uppercase letters. Each mapping is a pair of a lowercase and an uppercase letter separated with a , and enclosed in parentheses. The members of the list are separated with semicolons.
tolower
followed by a list of mappings from uppercase to lowercase letters. If the keyword tolower is not present, the reverse of the toupper list is used.

The LC_CTYPE definition ends with the string END LC_CYTPE.  

LC_COLLATE

The LC_COLLATE category defines the rules for collating characters. Due to limitations of libc not all POSIX-options are implemented.

The definition starts with the string LC_COLLATE in the first column.

There are the following keywords allowed:

collating-element
collating-symbol

The order-definition starts with a line:

order_start

followed by a list of keywords out of forward, backward, or position. The order definition consists of lines that describe the order and is terminated with the keyword

order_end.

For more details see the sources in /usr/lib/nls/src notably the examples POSIX, Example and Example2

The LC_COLLATE definition ends with the string END LC_COLLATE.  

LC_MONETARY

The definition starts with the string LC_MONETARY in the first column.

There are the following keywords allowed:

int_curr_symbol
followed by the international currency symbol. This must be a 4-character string containing the international currency symbol as defined by the ISO 4217 standard (three characters) followed by a separator.
currency_symbol
followed by the local currency symbol.
mon_decimal_point
followed by the string that will be used as the decimal delimiter when formatting monetary quantities.
mon_thousands_sep
followed by the string that will be used as a group separator when formatting monetary quantities.
mon_grouping
followed by a string that describes the formatting of numeric quantities.
positive_sign
followed by a string that is used to indicate a positive sign for monetary quantities.
negative_sign
followed by a string that is used to indicate a negative sign for monetary quantities.
int_frac_digits
followed by the number of fractional digits that should be used when formatting with the int_curr_symbol.
frac_digits
followed by the number of fractional digits that should be used when formatting with the currency_symbol.
p_cs_precedes
followed by an integer set to 1 if the currency_symbol or int_curr_symbol should precede the formatted monetary quantity or set to 0 if the symbol succeeds the value.
p_sep_by_space
followed by an integer.
0
means that no space should be printed between the symbol and the value.
1
means that a space should be printed between the symbol and the value.
2
means that a space should be printed between the symbol and the sign string, if adjacent.
n_cs_precedes
0
- the symbol succeeds the value.
1
- the symbol precedes the value.
n_sep_by_space
An integer set to 0 if no space separates the currency_symbol or int_curr_symbol from the value for a negative monetary quantity, set to 1 if a space separates the symbol from the value and set to 2 if a space separates the symbol and the sign string, if adjacent.
p_sign_posn
0
Parentheses enclose the quantity and the currency_symbol or int_curr_symbol.
1
The sign string precedes the quantity and the currency_symbol or the int_curr_symbol.
2
The sign string succeeds the quantity and the currency_symbol or the int_curr_symbol.
3
The sign string precedes the currency_symbol or the int_curr_symbol.
4
The sign string succeeds the currency_symbol or the int_curr_symbol.
n_sign_posn
0
Parentheses enclose the quantity and the currency_symbol or int_curr_symbol.
1
The sign string precedes the quantity and the currency_symbol or the int_curr_symbol.
2
The sign string succeeds the quantity and the currency_symbol or the int_curr_symbol.
3
The sign string precedes the currency_symbol or the int_curr_symbol.
4
The sign string succeeds the currency_symbol or the int_curr_symbol.

The LC_MONETARY definition ends with the string END LC_MONETARY.  

LC_NUMERIC

The definition starts with the string LC_NUMERIC in the first column.

The following keywords are allowed:

decimal_point
followed by the string that will be used as the decimal delimiter when formatting numeric quantities.
thousands_sep
followed by the string that will be used as a group separator when formatting numeric quantities.
grouping
followed by a string that describes the formatting of numeric quantities.

The LC_NUMERIC definition ends with the string END LC_NUMERIC.  

LC_TIME

The definition starts with the string LC_TIME in the first column.

The following keywords are allowed:

abday
followed by a list of abbreviated weekday names. The list starts with the first day of the week as specified by week (Sunday by default).
day
followed by a list of weekday names. The list starts with the first day of the week as specified by week (Sunday by default).
abmon
followed by a list of abbreviated month names.
mon
followed by a list of month names.
am_pm
The appropriate representation of the am and pm strings.
d_t_fmt
The appropriate date and time format.
d_fmt
The appropriate date format.
t_fmt
The appropriate time format.
t_fmt_ampm
The appropriate time format when using 12h clock format.
week
followed by a list of three values: The number of days in a week (by default 7), a date of beginning of the week (by default corresponds to Sunday), and the minimal length of the first week in year (by default 4). Regarding the start of the week, 19971130 shall be used for Sunday and 19971201 shall be used for Monday. Thus, countries using 19971130 should have local Sunday name as the first day in the day list, while countries using 19971201 should have Monday translation as the first item in the day list.
first_weekday (since glibc 2.2)
Number of the first day from the day list to be shown in calendar applications. The default value of 1 corresponds to either Sunday or Monday depending on the value of the second week list item.
first_workday (since glibc 2.2)
Number of the first working day from the day list.

The LC_TIME definition ends with the string END LC_TIME.  

LC_MESSAGES

The definition starts with the string LC_MESSAGES in the first column.

The following keywords are allowed:

yesexpr
followed by a regular expression that describes possible yes-responses.
noexpr
followed by a regular expression that describes possible no-responses.

The LC_MESSAGES definition ends with the string END LC_MESSAGES.

See the POSIX.2 standard for details.  

FILES

/usr/lib/locale/ --- database for the current locale setting of that category
/usr/lib/nls/charmap/* --- charmap-files  

CONFORMING TO

POSIX.2, ISO/IEC 14652.  

BUGS

This manual page isn't complete.  

SEE ALSO

locale(1), localedef(1), localeconv(3), setlocale(3), charmap(5)  

COLOPHON

This page is part of release 3.32 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.


 

Index

NAME
DESCRIPTION
Syntax
LC_CTYPE
LC_COLLATE
LC_MONETARY
LC_NUMERIC
LC_TIME
LC_MESSAGES
FILES
CONFORMING TO
BUGS
SEE ALSO
COLOPHON

This document was created by man2html using the manual pages.
Time: 17:31:25 GMT, October 23, 2013

4. locale.7.man

Manpage of LOCALE

LOCALE

Section: Linux Programmer's Manual (7)
Updated: 2008-12-05
Index Return to Main Contents
 

NAME

locale - Description of multilanguage support  

SYNOPSIS

#include <locale.h>
 

DESCRIPTION

A locale is a set of language and cultural rules. These cover aspects such as language for messages, different character sets, lexicographic conventions, etc. A program needs to be able to determine its locale and act accordingly to be portable to different cultures.

The header <locale.h> declares data types, functions and macros which are useful in this task.

The functions it declares are setlocale(3) to set the current locale, and localeconv(3) 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(3) function, it is possible to set one of these to the desired locale:

LC_COLLATE
This is used to change the behavior of the functions strcoll(3) and strxfrm(3), which are used to compare strings in the local alphabet. For example, the German sharp s is sorted as "ss".
LC_CTYPE
This changes the behavior of the character handling and classification functions, such as isupper(3) and toupper(3), and the multibyte character functions such as mblen(3) or wctomb(3).
LC_MONETARY
changes the information returned by localeconv(3) 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(3).
LC_MESSAGES
changes the language messages are displayed in and what an affirmative or negative answer looks like. The GNU C-library contains the gettext(3), ngettext(3), and rpmatch(3) functions to ease the use of these information. The GNU gettext family of functions also obey the environment variable LANGUAGE (containing a colon-separated list of locales) if the category is set to a valid locale other than C.
LC_NUMERIC
changes the information used by the printf(3) and scanf(3) family of functions, when they are advised to use the locale-settings. This information can also be read with the localeconv(3) function.
LC_TIME
changes the behavior of the 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 12-hour clock used in the United States.
LC_ALL
All of the above.

If the second argument to setlocale(3) 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(3) function, which has the following declaration:


struct lconv {

    /* Numeric (nonmonetary) information */

    char *decimal_point;     /* Radix character */
    char *thousands_sep;     /* Separator for digit groups to left
                                of radix character */
    char *grouping; /* Each element is the number of digits in a
                       group; elements with higher indices are
                       further 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 further left. */

    /* Remaining fields are for monetary information */

    char *int_curr_symbol;   /* First three chars are a currency symbol
                                from ISO 4217.  Fourth char is the
                                separator.  Fifth char is aq\0aq. */
    char *currency_symbol;   /* Local currency symbol */
    char *mon_decimal_point; /* Radix character */
    char *mon_thousands_sep; /* Like thousands_sep above */
    char *mon_grouping;      /* Like grouping above */
    char *positive_sign;     /* Sign for positive values */
    char *negative_sign;     /* Sign for negative values */
    char  int_frac_digits;   /* International fractional digits */
    char  frac_digits;       /* Local fractional digits */
    char  p_cs_precedes;     /* 1 if currency_symbol precedes a
                                positive value, 0 if succeeds */
    char  p_sep_by_space;    /* 1 if a space separates currency_symbol
                                from a positive value */
    char  n_cs_precedes;     /* 1 if currency_symbol precedes a
                                negative value, 0 if succeeds */
    char  n_sep_by_space;    /* 1 if a space separates currency_symbol
                                from a negative value */
    /* 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;
};
 

CONFORMING TO

POSIX.1-2001.

The GNU gettext functions are specified in LI18NUX2000.  

SEE ALSO

locale(1), localedef(1), gettext(3), localeconv(3), ngettext(3), nl_langinfo(3), rpmatch(3), setlocale(3), strcoll(3), strfmon(3), strftime(3), strxfrm(3)  

COLOPHON

This page is part of release 3.32 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.


 

Index

NAME
SYNOPSIS
DESCRIPTION
CONFORMING TO
SEE ALSO
COLOPHON

This document was created by man2html using the manual pages.
Time: 17:31:25 GMT, October 23, 2013

cs - ENGLISH - ENGLISH - ENGLISH - ENGLISH - ja - pl - ENGLISH

Meet new people