locale 中文man页面

系统
地域 定义文件含有 localedef(1) 命令所需的全部信息.

NAME

locale - 地域定义文件的描述  

描述

地域 定义文件含有 localedef(1) 命令所需的全部信息.

定义文件由几个小节组成, 一个小节详细地描述地域的一个范畴.  

语法

地域定义文件以一个包含有如下关键字的文件头开头:

<escape_char>
其后所跟字符在文件的其余部分被特别解释为逃逸字符, 逃逸字符缺省为反斜杠( \\ ).
<comment_char>
后面所跟字符在文件的其余部分要特别解释为注释符, 注释符缺省为数字符号( # ).

地域定义分成几个部分, 每个部分对应一个地域范畴, 每个部分都可以复制别的地域范畴的内容, 也可以自己重新新定义一个, 如果一个范畴想要复制别的范畴, 则在该范畴的定义里唯一有效的关键字是 copy, 其后跟随要复制的地域范畴的名字.

LC_CTYPE

LC_CTYPE 范畴的定义以第一栏的 LC_CTYPE 字符串开始.

可以有如下关键字:

upper
跟随一个大写字母列表. 字母 AZ 自动包括. 被说明为 cntrl, digit, punct,space 的字符则不允许包括.
lower
跟随一个小写字母列表. 字母 az 自动包括. 同样也不允许如下字符: cntrl, digit, punct, 或者 space.
alpha
跟随一个字母列表. 所有被说明为 upperlower 的字符都自动包括. 但如下字符仍然不允许: cntrl, digit, punct,space
digit
后面跟随的字符被划分为数字. 只允许数字 0 9 , 并且缺省它们也被包括进来了.
space
跟随一列被定义为空格的字符. 那些被说明为 upper, lower, alpha, digit, graph, 或者 xdigit 的字符是不被允许的. 而字符 <space>, <form-feed>, <newline>, <carriage-return>, <tab>, 以及 <vertical-tab> 则被自动包括进来.
cntrl
跟随一个控制字符列表.那些被说明为 upper, lower, alpha, digit, punct, graph, print 或者 xdigit 的字符不允许包括.
punct
跟随一个标点符号的列表. 不允许包括那些被说明为 upper, lower, alpha, digit, cntrl, xdigit 或者 <space> 字符.
graph
跟随一个可打印字符列表, 但不包括空格符 <space>. 被说明为 upper, lower, alpha, digit, xdigitpunct 的字符自动包括, 而被说明为 cntrl 的字符则不允许包括.
print
跟随一个可打印字符列表, 包括空格符 <space>. 被定义为 upper, lower, alpha, digit, xdigit, punct<space> 的字符自动包括. 而被说明为 cntrl 的字符则不被允许.
xdigit
跟随一个被归类为十六进制数的字符的列表. 十进制数字必须被包括, 其后还有一个或多个的升序顺序的六字符集, 缺省包括下列字符: 09, af, AF.
blank
跟随一个被归类为 blank 字符的列表. 自动包括的字符有 <space><tab>.
toupper
跟随一个从小写字母到大写字母的映射列表. 每个映射都是一个小写-大写字母对, 中间以 , 分隔, 并且用圆括号括起来. 各个映射之间则用分号分隔.
tolower
跟随一个从大写字母到小写字母的映射列表. 如果没有出现关键字tolower的话, 就使用它的逆toupper.

LC_CTYPE 定义以字符串 END LC_CYTPE 结束.

LC_COLLATE

LC_COLLATE 范畴定义了校对字符的规则. 由于libc的局限性, 所以并没有实现所有的POSIX选项.

该定义以第一栏的字符串 LC_COLLATE 为开始标记.

允许如下关键字:

collating-element
collating-symbol

order-definition以下列行开始:

order_start

后随一个如下关键字的列表: forward, backward 或者 position. 顺序定义由一些描述顺序的行组成, 并以如下关键字终止,

order_end.

要得到更多细节请查阅在 /usr/lib/nls/src 里的源代码. 请注意几个例子: POSIX, Example 以及 Example2.

LC_COLLATE 的定义以字符串 END LC_COLLATE 结束.

LC_MONETARY

该定义以第一栏里的字符串 LC_MONETARY 开始.

可以有如下关键字:

int_curr_symbol
其后跟随国际货币符号. 必须是一个四字符的字符串, 包含有ISO 4217标准所定义的国际货币符号(三字符)以及一个分隔符号.
currency_symbol
其后跟随当地的货币符号.
mon_decimal_point
其后跟随一个字符串, 该字符串在格式化货币的数额时用做十进制定界符号.
mon_thousands_sep
其后跟随一个字符串, 该字符串在格式化货币的数额时用做组分隔符号.
mon_grouping
其后跟随一个字符串, 该字符串描述货币数额格式.
positive_sign
其后跟随一个字符串, 该字符串被用于指示货币数额的正号.
negative_sign
其后跟随一个字符串, 该字符串被用于指示货币数额的负号.
int_frac_digits
其后跟随货币数额的小数部分的数字位数, 该数在用 int_curr_symbol 格式化货币数额时要用到.
frac_digits
其后跟随货币数额的小数部分的数字位数, 该数在用 currency_symbol 格式化货币数额时要用到.
p_cs_precedes
其后跟随一个整数, 如果 currency_symbol 或者 int_curr_symbol 要置于格式化的货币数额前面, 该整数就为 1, 否则为 0.
p_sep_by_space
跟随一个整数,
0
表明在货币符号和数额之间不打印空格,
1
表明在货币符号和数额之间打印一个空格,
2
的意思是如果货币符号与数额的正号相邻的话, 其间打印一个空格,
n_cs_precedes
0
- 负号跟随于数额,
1
- 负号领先于数额,
n_sep_by_space
一个整数,设为 0 要求在 currency_symbol 或者 int_curr_symbol 和一个负的货币数额之间没有空格分隔, 设为 1 则要求在两者之间有一个空格分隔, 而设为 2 则要求在货币符号和负号之间有一个空格分隔, 如果这两者相邻的话,
p_sign_posn
0
意思是要用括号括住 currency_symbolint_curr_symbol. 和货币数额,
1
正号要领先于货币数额和货币符号 currency_symbolint_curr_symbol.
2
正号跟在货币数额和货币符号 currency_symbolint_curr_symbol 的后面.
3
正号领先于货币符号 currency_symbolint_curr_symbol.
4
正号跟在货币符号 currency_symbolint_curr_symbol 的后面.
n_sign_posn
0
意思是要用括号括住 currency_symbolint_curr_symbol. 和货币数额,
1
负号领先于货币数额及货币符号 currency_symbolint_curr_symbol.
2
负号跟在货币数量及货币符号 currency_symbolint_curr_symbol 的后面.
3
负号领先于货币符号 currency_symbolint_curr_symbol.
4
负号跟在货币符号 currency_symbolint_curr_symbol 的后面.

LC_MONETARY 定义以字符串 END LC_MONETARY. 结束,

LC_NUMERIC

该定义以第一栏的字符串 LC_NUMERIC 开始.

可有如下关键字:

decimal_point
跟随一个字符串, 该串在格式化数量值时用作十进制定界符,
thousands_sep
跟随一个字符串, 该串在格式化数量值时用作群组分隔符,
grouping
跟随一个字符串, 该串描述数量值的格式化,

LC_NUMERIC 定义以字符串 END LC_NUMERIC. 结束,

LC_TIME

该定义以第一栏的字符串 LC_TIME 开始,

可以有如下关键字:

abday
跟随一个简写星期名列表, 该列表以Sunday或其译名开头,
day
跟随一个星期名列表, 该列表以Sunday开头,
abmon
跟随一个简写的月名列表,
mon
跟随一个月名列表,
am_pm
ampm 的适当表示,
d_t_fmt
适当的日期加时间格式,
d_fmt
适当的日期格式,
t_fmt
适当的时间格式,
t_fmt_ampm
适当的时间格式(12小时格式),

LC_TIME 定义以字符串 END LC_TIME. 结束,

LC_MESSAGES

该定义以第一栏的字符串 LC_MESSAGES 开始,

可以有如下关键字:

yesexpr
跟随一个正则表达式, 描述可能的yes-responses.
noexpr
跟随一个正则表达式, 描述可能的no-responses.

LC_MESSAGES 定义以字符串 END LC_MESSAGES 结束.

要得到更多细节, 请查阅POSIX.2标准.  

文件

/usr/lib/locale/       - 当前地域范畴设置数据库
/usr/lib/nls/charmap/*  - 字符映射文件
 

BUGS

该手册页并不完全.  

作者

Jochen Hein (Hein@Student.TU-Clausthal.de)  

CONFORMING TO

POSIX.2  

另见

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

#p#

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 trough 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 trough 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 trough 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 trough 9, a trough f, A trough 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 Sunday or its translation.
day
followed by a list of weekday names. The list starts with Sunday.
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.

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  

BUGS

The manpage isn't complete.  

CONFORMING TO

POSIX.2  

SEE ALSO

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

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:25:41

locale中文man

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-16 10:59:16

pwconv中文man

2011-08-25 17:43:07

snprintf中文man

2011-08-19 18:30:52

ipc中文man

2011-08-25 17:18:07

putc中文man

2011-08-15 13:53:19

stat中文man

2011-08-25 15:24:31

execlp中文man

2011-08-15 18:06:07

restore中文man

2011-08-24 17:26:35

reindex中文man

2011-08-15 15:45:04

xpdf中文man

2011-08-24 17:06:42

NOTIFY中文man

2011-08-15 14:42:28

uname中文man

2011-08-15 11:30:37

pwd中文man

2011-08-23 14:24:42

ping中文man

2011-08-15 11:01:45

点赞
收藏

51CTO技术栈公众号