OSDN Git Service

06115980fb3f112176428779f1fb42e2ac243c78
[linuxjm/LDP_man-pages.git] / release / man3 / setlocale.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\" and Copyright 1999 by Bruno Haible (haible@clisp.cons.org)
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" License.
24 .\" Modified Sat Jul 24 18:20:12 1993 by Rik Faith (faith@cs.unc.edu)
25 .\" Modified Tue Jul 15 16:49:10 1997 by Andries Brouwer (aeb@cwi.nl)
26 .\" Modified Sun Jul  4 14:52:16 1999 by Bruno Haible (haible@clisp.cons.org)
27 .\" Modified Tue Aug 24 17:11:01 1999 by Andries Brouwer (aeb@cwi.nl)
28 .\" Modified Tue Feb  6 03:31:55 2001 by Andries Brouwer (aeb@cwi.nl)
29 .\"
30 .\" Japanese Version Copyright (c) 1998 Tanoshima Hidetohsi
31 .\"         all rights reserved.
32 .\" Translated May 29, 1998   Tanoshima Hidetoshi <tano@sainet.or.jp>
33 .\" Modified Mon Oct  2 11:09:18 JST 2000
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated Fri May  4 01:49:48 JST 2001
36 .\"         by Kentaro Shirakata <argrath@ub32.org>
37 .\" Updated Sat Oct 12 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
38 .\"
39 .\"WORD:        locale                  ¥í¥±¡¼¥ë
40 .\"WORD:        portable                ¸ß´¹À­¤Î¤¢¤ë
41 .\"WORD:        regular expression      Àµµ¬É½¸½
42 .\"WORD:        range expressions       ÈÏ°Ïɽ¸½
43 .\"WORD:        equivalence classes     Åù²Á¥¯¥é¥¹
44 .\"WORD:        collation               ¾È¹ç
45 .\"WORD:        multibyte character     Â¿¥Ð¥¤¥Èʸ»ú
46 .\"WORD:        wide character          ¥ï¥¤¥Éʸ»ú
47 .\"WORD:        opaque string           ÆâÉôʸ»úÎó
48 .\"
49 .TH SETLOCALE 3  2008-12-05 "GNU" "Linux Programmer's Manual"
50 .SH Ì¾Á°
51 setlocale \- ¸½ºß¤Î¥í¥±¡¼¥ë (locale) ¤òÀßÄꤹ¤ë
52 .SH ½ñ¼°
53 .nf
54 .B #include <locale.h>
55 .sp
56 .BI "char *setlocale(int " category ", const char *" locale );
57 .fi
58 .SH ÀâÌÀ
59 .BR setlocale ()
60 ´Ø¿ô¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤òÀßÄꤷ¤¿¤ê
61 Ì䤤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£
62 .PP
63 .I locale
64 ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Ï°ú¤­¿ô¤Ë½¾¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£
65 °ú¤­¿ô
66 .I category
67 ¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î¤É¤ÎÉôʬ¤òÊѹ¹¤¹¤ë¤«¤ò·è¤á¤ë¡£
68 .TP
69 .B LC_ALL
70 Á´¤Æ¤Î¥í¥±¡¼¥ë
71 .TP
72 .B LC_COLLATE
73 Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥° (ÈÏ°Ïɽ¸½¤ÈÅù²Á¥¯¥é¥¹¤Î¥Þ¥Ã¥Á¥ó¥°¤ò·èÄꤹ¤ë)
74 ¤Èʸ»úÎó¤Î¾È¹ç (collation)
75 .TP
76 .B LC_CTYPE
77 Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥°¡¢Ê¸»ú¤ÎʬÎࡢʸ»ú¤ÎÊÑ´¹¡¢Âçʸ»ú¾®Ê¸»úÈæ³Ó¡¢
78 ¥ï¥¤¥Éʸ»ú´Ø¿ô
79 .TP
80 .B LC_MESSAGES
81 ÃÏ°è²½²Äǽ¤Ê¼«Á³¸À¸ì¥á¥Ã¥»¡¼¥¸
82 .TP
83 .B LC_MONETARY
84 Ä̲ߤνñ¼°
85 .TP
86 .B LC_NUMERIC
87 ¿ôÃͤνñ¼° (¾®¿ôÅÀ¤ä 3 ·å¤´¤È¤Î¶èÀÚ¤ê)
88 .TP
89 .B LC_TIME
90 »þ¹ï¤ÈÆüÉÕ¤±¤Î½ñ¼°
91 .PP
92 °ú¤­¿ô
93 .I locale
94 ¤Ï
95 .I category
96 ¤ËÀßÄꤹ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
97 ¤³¤Îʸ»úÎó¤Ï¤è¤¯ÃΤé¤ì¤¿Äê¿ô¤Ç¤¢¤ë "C" ¤ä "da_DK" ¤Ê¤É¤Ç¤âÎɤ¤¤·
98 (°Ê²¼¤ò»²¾È)¡¢Â¾¤Î¤È¤­¤Ë
99 .BR setlocale ()
100 ¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤¿¡¢ÆâÉôÍѤÎʸ»úÎó¤Ç¤âÎɤ¤¡£
101 .PP
102 .I locale
103 ¤¬ \fB""\fP ¤Î¾ì¹ç¡¢¥í¥±¡¼¥ë¤Î³ÆÉôʬ¤ÎÀßÄê¤Ë¤Ï´Ä¶­ÊÑ¿ô¤¬»²¾È¤µ¤ì¤ë¡£
104 ¤½¤Î¾ÜºÙ¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£
105 glibc ¤Î¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë (¤É¤ó¤Ê
106 .I category
107 ¤ËÂФ·¤Æ¤â) ´Ä¶­ÊÑ¿ô
108 .B LC_ALL
109 ¤¬¸¡ºº¤µ¤ì¤ë¡£
110 ¼¡¤Ë¥«¥Æ¥´¥ê (category) ¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶­ÊÑ¿ô
111 .RB ( LC_COLLATE ,
112 .BR LC_CTYPE ,
113 .BR LC_MESSAGES ,
114 .BR LC_MONETARY ,
115 .BR LC_NUMERIC ,
116 .BR LC_TIME )
117 ¤¬¸¡ºº¤µ¤ì¡¢ºÇ¸å¤Ë´Ä¶­ÊÑ¿ô
118 .B LANG
119 ¤¬¸¡ºº¤µ¤ì¤ë¡£
120 ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¡£
121 ¤½¤ÎÃͤ¬¥í¥±¡¼¥ë»ØÄê¤È¤·¤ÆÀµ¤·¤¯¤Ê¤±¤ì¤Ð¡¢¥í¥±¡¼¥ë¤ÏÊѹ¹¤µ¤ì¤º¡¢
122 .BR setlocale ()
123 ¤Ï NULL ¤òÊÖ¤¹¡£
124 .PP
125 \fB"C"\fP ¥í¥±¡¼¥ë¤ä \fB"POSIX"\fP ¥í¥±¡¼¥ë¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤Ç¤¢¤ë¡£
126 ¤³¤Î
127 .B LC_CTYPE
128 ¤ÎÉôʬ¤Ï 7 ¥Ó¥Ã¥È ASCII Ê¸»ú½¸¹ç¤ËÁêÅö¤·¤Æ¤¤¤ë¡£
129 .PP
130 ¥í¥±¡¼¥ë̾¤Î½ñ¼°¤Ï¡¢Ä̾ï
131 .IR language "[_" territory "][." codeset "][@" modifier "]"
132 ¤È¤¤¤¦¤â¤Î¤Ç¤¢¤ë¡£
133 ¤³¤³¤Ç
134 .I language
135 ¤Ï ISO 639 ¤Î¸À¸ì¥³¡¼¥É¤Ç¤¢¤ë¡£
136 .I territory
137 ¤Ï ISO 3166 ¤Î¹ñ̾¥³¡¼¥É¤Ç¤¢¤ë¡£
138 .I codeset
139 ¤Ï
140 .B "ISO-8859-1"
141 ¤ä
142 .B "UTF-8"
143 ¤Î¤è¤¦¤Êʸ»ú½¸¹ç¤äʸ»úÉä¹æ²½¼±Ê̻ҤǤ¢¤ë¡£
144 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Î°ìÍ÷¤òÆÀ¤ë¤Ë¤Ï¡¢
145 "locale \-a" ¤ò¼Â¹Ô¤·¤Æ¤ß¤è
146 .RB ( locale (1)
147 »²¾È¤Î¤³¤È)¡£
148 .PP
149 .I locale
150 ¤¬ NULL ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤òÌ䤤¹ç¤ï¤»¤ë¤Î¤ß¤ÇÊѹ¹¤Ï¤·¤Ê¤¤¡£
151 .PP
152 main ¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢
153 ¸ß´¹À­¤Î¤¢¤ë \fB"C"\fP ¥í¥±¡¼¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÁªÂò¤µ¤ì¤ë¡£
154 ¥×¥í¥°¥é¥à¤ò¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤ËÂФ·¤Æ¸ß´¹¤Ë¤·¤¿¤±¤ì¤Ð¡¢
155 ¥×¥í¥°¥é¥à¤Î½é´ü²½¤Î¸å¤Ë
156 .nf
157
158     setlocale(LC_ALL, "");
159
160 .fi
161 ¤ò¸Æ¤Ó½Ð¤·¡¢¥í¥±¡¼¥ë°Í¸¤Î¾ðÊó¤Ë¤Ï
162 .BR localeconv (3)
163 ¤ÎÊÖ¤êÃͤòÍѤ¤¡¢
164 .BR "MB_CUR_MAX > 1"
165 ¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤ÎÁàºî¤Ë¤Ï¿¥Ð¥¤¥Èʸ»ú¡¢¥ï¥¤¥Éʸ»ú´Ø¿ô¤ò»ÈÍѤ·¡¢
166 ʸ»úÎó¤ÎÈæ³Ó¤Ë¤Ï
167 .BR strcoll (3),
168 .BR wcscoll (3)
169 ¤ä
170 .BR strxfrm (3),
171 .BR wcsxfrm (3)
172 ¤òÍѤ¤¤ë¡£
173 .SH ÊÖ¤êÃÍ
174 .BR setlocale ()
175 ¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢
176 ¤½¤Î¥í¥±¡¼¥ë½¸¹ç¤ËÂбþ¤¹¤ëÆâÉôʸ»úÎó (opaque string) ¤òÊÖ¤¹¡£
177 ¤³¤Îʸ»úÎó¤ÏÀÅŪ¤Êµ­²±°è¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
178 ¤³¤ÎÊ֤äÆÍ褿ʸ»úÎó¤ò¡¢¥«¥Æ¥´¥ê»ØÄê¤È¶¦¤Ë¡¢
179 ¤Î¤Á¤Î setlocale ¤Î¸Æ¤Ó½Ð¤·¤Ë»ØÄꤹ¤ì¤Ð¡¢
180 ¥×¥í¥»¥¹¤Î¤½¤ÎÉôʬ¤Î¥í¥±¡¼¥ë¤¬Éü¸µ¤µ¤ì¤ë¡£
181 ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤êÃͤϠNULL ¤Ë¤Ê¤ë¡£
182 .SH ½àµò
183 C89, C99, POSIX.1-2001.
184 .SH Ãí°Õ
185 Linux (¤È¤¤¤¦¤« glibc) ¤Ï¸ß´¹À­¤Î¤¢¤ë¥í¥±¡¼¥ë¤È¤·¤Æ
186 \fB"C"\fP ¤È \fB"POSIX"\fP ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
187 ¸Å¤­¤è¤­»þÂå¤Ë¤Ï (Î㤨¤Ð libc-4.5.21 ¤È libc-4.6.27 ¤Ê¤É¤Ç¤Ï)¡¢
188 European Latin-1 ¸þ¤±¤Ë
189 \fB"ISO-8859-1"\fP ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤ª¤ê¡¢
190 ¥í¥·¥¢¸ì (Russian) ¸þ¤±¤Ë \fB"KOI-8"\fP
191 (¤è¤êÀµ³Î¤Ë¤Ï "koi-8r") ¥í¥±¡¼¥ë¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿¡£
192 ½¾¤Ã¤Æ´Ä¶­ÊÑ¿ô¤ò \fILC_CTYPE=ISO-8859-1\fP ¤È»ØÄꤹ¤ë¤À¤±¤Ç
193 .BR isprint (3)
194 ¤ÏÀµ¤·¤¤Åú¤¨¤òÊÖ¤·¤¿¡£
195 ºÇ¶á¤Ç¤Ï¡¢±Ñ¸ì°Ê³°¤ò»È¤¦¥è¡¼¥í¥Ã¥Ñ¿Í¤Ï¤â¤¦¾¯¡¹¤ä¤Ã¤«¤¤¤Êºî¶È¤òɬÍפȤ·¡¢
196 ¼ÂºÝ¤Î¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
197 .SH ´ØÏ¢¹àÌÜ
198 .BR locale (1),
199 .BR localedef (1),
200 .BR isalpha (3),
201 .BR localeconv (3),
202 .BR nl_langinfo (3),
203 .BR rpmatch (3),
204 .BR strcoll (3),
205 .BR strftime (3),
206 .BR charsets (7),
207 .BR locale (7)