1 .\" Copyright (c) 2001 Markus Kuhn <mkuhn@acm.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
10 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .\" Corrected prototype, 2002-10-18, aeb
14 .\" Japanese Version Copyright (c) 2001
15 .\" UCHIDA Norihiro all rights reserved.
16 .\" Translated Sun Jul 15 2001
17 .\" by UCHIDA Norihiro <KY4N-UCD@asahi-net.or.jp>
19 .TH NL_LANGINFO 3 2010-10-03 "GNU" "Linux Programmer's Manual"
21 .\"O nl_langinfo \- query language and locale information
23 nl_langinfo \- 言語とロケールの情報を問い合わせる
27 .B #include <langinfo.h>
29 .BI "char *nl_langinfo(nl_item " item );
34 .\"O .BR nl_langinfo ()
35 .\"O function provides access to locale information
36 .\"O in a more flexible way than
37 .\"O .BR localeconv (3)
39 .\"O Individual and additional elements of the locale categories can
44 より柔軟なロケール情報へのアクセス方法を提供する。
45 ロケールカテゴリの個々の要素や追加の要素を問い合わせることができる。
47 .\"O Examples for the locale elements that can be specified in \fIitem\fP
48 .\"O using the constants defined in \fI<langinfo.h>\fP are:
49 \fI<langinfo.h>\fP に定数として定義されていて、
50 \fIitem\fP に指定できるロケール要素の例を以下に示す:
52 .BR CODESET \ (LC_CTYPE)
53 .\"O Return a string with the name of the character encoding used in the
54 .\"O selected locale, such as "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968"
55 .\"O (better known as US-ASCII).
56 .\"O This is the same string that you get with
57 .\"O "locale charmap".
58 .\"O For a list of character encoding names,
59 .\"O try "locale \-m", cf.\&
61 選択されたロケールで用いられる文字エンコード名を示す文字列を返す。
62 文字エンコード名としては、"UTF-8" や "ISO-8859-1"、"ANSI_X3.4-1968"
63 (これは US-ASCII という名前の方がよく知られている) などがある。
64 この文字列は、"locale charmap" を実行して得られるものと同じである。
65 文字エンコード名のリストを得るには、"locale \-m" を実行するとよい。
69 .BR D_T_FMT \ (LC_TIME)
70 .\"O Return a string that can be used as a format string for
72 .\"O to represent time and date in a locale-specific way.
78 .\"O Return a string that can be used as a format string for
80 .\"O to represent a date in a locale-specific way.
86 .\"O Return a string that can be used as a format string for
88 .\"O to represent a time in a locale-specific way.
93 .BR DAY_ "{1\(en7} (LC_TIME)"
94 .\"O Return name of the \fIn\fP-th day of the week. [Warning: this follows
95 .\"O the US convention DAY_1 = Sunday, not the international convention
96 .\"O (ISO 8601) that Monday is the first day of the week.]
97 曜日名 (週の \fIn\fP 番目の日の名前) を返す。[警告: この要素はアメリカの
98 慣習に従って DAY_1 が 日曜日となる。国際的な慣習 (ISO 8601) では月曜日が
101 .BR ABDAY_ "{1\(en7} (LC_TIME)"
102 .\"O Return abbreviated name of the \fIn\fP-th day of the week.
103 曜日 (週の \fIn\fP 番目の日) の省略名を返す。
105 .BR MON_ "{1\(en12} (LC_TIME)"
106 .\"O Return name of the \fIn\fP-th month.
109 .BR ABMON_ "{1\(en12} (LC_TIME)"
110 .\"O Return abbreviated name of the \fIn\fP-th month.
113 .BR RADIXCHAR \ (LC_NUMERIC)
114 .\"O Return radix character (decimal dot, decimal comma, etc.).
115 基数記号 (小数点やコンマなど) を返す。
117 .BR THOUSEP \ (LC_NUMERIC)
118 .\"O Return separator character for thousands (groups of three digits).
119 千の位 (3 桁の数値) の区切り文字を返す。
121 .BR YESEXPR \ (LC_MESSAGES)
122 .\"O Return a regular expression that can be used with the
124 .\"O function to recognize a positive response to a yes/no question.
125 yes/no の質問に対する肯定の応答を認識するために、
129 .BR NOEXPR \ (LC_MESSAGES)
130 .\"O Return a regular expression that can be used with the
132 .\"O function to recognize a negative response to a yes/no question.
133 yes/no の質問に対する否定の応答を認識するために
137 .BR CRNCYSTR \ (LC_MONETARY)
138 .\"O Return the currency symbol, preceded by "\-" if the symbol should
139 .\"O appear before the value, "+" if the symbol should appear after the
140 .\"O value, or "." if the symbol should replace the radix character.
142 記号が数値の前に配置される場合は、"\-" が通貨記号に前置される。
143 数値の後に記号が配置される場合は "+" が、
144 記号が基数文字と置き換わる場合は "." が前置される。
146 .\"O The above list covers just some examples of items that can be requested.
147 .\"O For a more detailed list, consult
148 .\"O .IR "The GNU C Library Reference Manual" .
149 上記のリストは、要求できる定義のごく一部である。
151 .I "GNU C ライブラリ・リファレンスマニュアル"
153 .\"O .SH "RETURN VALUE"
155 .\"O If no locale has been selected by
156 .\"O .BR setlocale (3)
157 .\"O for the appropriate category,
158 .\"O .BR nl_langinfo ()
159 .\"O returns a pointer to the corresponding string in the
165 は "C" ロケールのときに相当する文字列へのポインタを返す。
167 .\"O If \fIitem\fP is not valid, a pointer to an empty string is returned.
168 無効な \fIitem\fP の場合は、空文字列へのポインタが返される。
170 .\"O This pointer may point to static data that may be overwritten on the
171 .\"O next call to \fBnl_langinfo\fP() or
172 .\"O .BR setlocale (3).
173 このポインタは静的なデータ領域を指し、その内容は次回の
178 .\"O .SH "CONFORMING TO"
183 .\"O The following program sets the character type locale according to the
184 .\"O environment and queries the terminal character set.
185 以下のプログラムは、環境変数に基いて文字型 (character type) のロケール
186 を設定し、端末の文字集合の問い合わせを行う。
189 #include <langinfo.h>
195 main(int argc, char *argv[])
197 setlocale(LC_CTYPE,"");
198 printf("%s\\n",nl_langinfo(CODESET));
210 .\"O The GNU C Library Reference Manual
211 GNU C ライブラリ・リファレンスマニュアル