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.
73 ¥í¥±¡¼¥ë¸Çͤλþ´Ö¤ÈÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤¤Ë¡¢
75 ¤Ç»ÈÍѤǤ¤ë½ñ¼°Éդʸ»úÎó¤òÊÖ¤¹¡£
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.
81 ¥í¥±¡¼¥ë¸ÇͤÎÆüÉÕ¤òɽ¸½¤¹¤ë¤È¤¤Ë¡¢
83 ¤Ç»ÈÍѤǤ¤ë½ñ¼°Éդʸ»úÎó¤òÊÖ¤¹¡£
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.
89 ¥í¥±¡¼¥ë¸Çͤλþ´Ö¤òɽ¸½¤¹¤ë¤È¤¤Ë¡¢
91 ¤Ç»ÈÍѤǤ¤ë½ñ¼°Éդʸ»úÎó¤òÊÖ¤¹¡£
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.
107 \fIn\fP ÈÖÌܤηî¤Î̾Á°¤òÊÖ¤¹¡£
109 .BR ABMON_ "{1\(en12} (LC_TIME)"
110 .\"O Return abbreviated name of the \fIn\fP-th month.
111 \fIn\fP ÈÖÌܤηî¤Î¾Êά̾¤òÊÖ¤¹¡£
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 ¤Î¼ÁÌä¤ËÂФ¹¤ë¹ÎÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë¡¢
127 ´Ø¿ô¤Ç»ÈÍѤǤ¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£
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 ¤Î¼ÁÌä¤ËÂФ¹¤ëÈÝÄê¤Î±þÅú¤òǧ¼±¤¹¤ë¤¿¤á¤Ë
135 ´Ø¿ô¤Ç»ÈÍѤǤ¤ëÀµµ¬É½¸½¤òÊÖ¤¹¡£
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
161 ŬÀڤʥ«¥Æ¥´¥ê¤Î¥í¥±¡¼¥ë¤¬
163 ¤Ë¤è¤Ã¤ÆÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢
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 ¤³¤Î¥Ý¥¤¥ó¥¿¤ÏÀÅŪ¤Ê¥Ç¡¼¥¿Îΰè¤ò»Ø¤·¡¢¤½¤ÎÆâÍƤϼ¡²ó¤Î
177 ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ½ñ¤Âؤï¤ë¤³¤È¤¬¤¢¤ë¡£
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 ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë