1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\" and Copyright 1999 by Bruno Haible (haible@clisp.cons.org)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
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)
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>
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 ÆâÉôʸ»úÎó
49 .TH SETLOCALE 3 2008-12-05 "GNU" "Linux Programmer's Manual"
51 setlocale \- ¸½ºß¤Î¥í¥±¡¼¥ë (locale) ¤òÀßÄꤹ¤ë
54 .B #include <locale.h>
56 .BI "char *setlocale(int " category ", const char *" locale );
60 ´Ø¿ô¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤òÀßÄꤷ¤¿¤ê
61 Ì䤤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£
64 ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Ï°ú¤¿ô¤Ë½¾¤Ã¤ÆÊѹ¹¤µ¤ì¤ë¡£
67 ¤Ï¥×¥í¥°¥é¥à¤Î¥«¥ì¥ó¥È¥í¥±¡¼¥ë¤Î¤É¤ÎÉôʬ¤òÊѹ¹¤¹¤ë¤«¤ò·è¤á¤ë¡£
73 Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥° (ÈÏ°Ïɽ¸½¤ÈÅù²Á¥¯¥é¥¹¤Î¥Þ¥Ã¥Á¥ó¥°¤ò·èÄꤹ¤ë)
74 ¤Èʸ»úÎó¤Î¾È¹ç (collation)
77 Àµµ¬É½¸½¤Î¥Þ¥Ã¥Á¥ó¥°¡¢Ê¸»ú¤ÎʬÎࡢʸ»ú¤ÎÊÑ´¹¡¢Âçʸ»ú¾®Ê¸»úÈæ³Ó¡¢
81 ÃÏ°è²½²Äǽ¤Ê¼«Á³¸À¸ì¥á¥Ã¥»¡¼¥¸
87 ¿ôÃͤνñ¼° (¾®¿ôÅÀ¤ä 3 ·å¤´¤È¤Î¶èÀÚ¤ê)
96 ¤ËÀßÄꤹ¤ëʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
97 ¤³¤Îʸ»úÎó¤Ï¤è¤¯ÃΤé¤ì¤¿Äê¿ô¤Ç¤¢¤ë "C" ¤ä "da_DK" ¤Ê¤É¤Ç¤âÎɤ¤¤·
98 (°Ê²¼¤ò»²¾È)¡¢Â¾¤Î¤È¤¤Ë
100 ¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤ËÊÖ¤µ¤ì¤¿¡¢ÆâÉôÍѤÎʸ»úÎó¤Ç¤âÎɤ¤¡£
103 ¤¬ \fB""\fP ¤Î¾ì¹ç¡¢¥í¥±¡¼¥ë¤Î³ÆÉôʬ¤ÎÀßÄê¤Ë¤Ï´Ä¶ÊÑ¿ô¤¬»²¾È¤µ¤ì¤ë¡£
104 ¤½¤Î¾ÜºÙ¤Ï¼ÂÁõ°Í¸¤Ç¤¢¤ë¡£
105 glibc ¤Î¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë (¤É¤ó¤Ê
110 ¼¡¤Ë¥«¥Æ¥´¥ê (category) ¤ÈƱ¤¸Ì¾Á°¤Î´Ä¶ÊÑ¿ô
117 ¤¬¸¡ºº¤µ¤ì¡¢ºÇ¸å¤Ë´Ä¶ÊÑ¿ô
120 ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿´Ä¶ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¡£
121 ¤½¤ÎÃͤ¬¥í¥±¡¼¥ë»ØÄê¤È¤·¤ÆÀµ¤·¤¯¤Ê¤±¤ì¤Ð¡¢¥í¥±¡¼¥ë¤ÏÊѹ¹¤µ¤ì¤º¡¢
125 \fB"C"\fP ¥í¥±¡¼¥ë¤ä \fB"POSIX"\fP ¥í¥±¡¼¥ë¤Ï¸ß´¹À¤Î¤¢¤ë¥í¥±¡¼¥ë¤Ç¤¢¤ë¡£
128 ¤ÎÉôʬ¤Ï 7 ¥Ó¥Ã¥È ASCII ʸ»ú½¸¹ç¤ËÁêÅö¤·¤Æ¤¤¤ë¡£
130 ¥í¥±¡¼¥ë̾¤Î½ñ¼°¤Ï¡¢Ä̾ï
131 .IR language "[_" territory "][." codeset "][@" modifier "]"
135 ¤Ï ISO 639 ¤Î¸À¸ì¥³¡¼¥É¤Ç¤¢¤ë¡£
137 ¤Ï ISO 3166 ¤Î¹ñ̾¥³¡¼¥É¤Ç¤¢¤ë¡£
143 ¤Î¤è¤¦¤Êʸ»ú½¸¹ç¤äʸ»úÉä¹æ²½¼±Ê̻ҤǤ¢¤ë¡£
144 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥í¥±¡¼¥ë¤Î°ìÍ÷¤òÆÀ¤ë¤Ë¤Ï¡¢
145 "locale \-a" ¤ò¼Â¹Ô¤·¤Æ¤ß¤è
150 ¤¬ NULL ¤Ê¤é¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤òÌ䤤¹ç¤ï¤»¤ë¤Î¤ß¤ÇÊѹ¹¤Ï¤·¤Ê¤¤¡£
152 main ¥×¥í¥°¥é¥à¤Îµ¯Æ°»þ¤Ë¤Ï¡¢
153 ¸ß´¹À¤Î¤¢¤ë \fB"C"\fP ¥í¥±¡¼¥ë¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÁªÂò¤µ¤ì¤ë¡£
154 ¥×¥í¥°¥é¥à¤ò¤¹¤Ù¤Æ¤Î¥í¥±¡¼¥ë¤ËÂФ·¤Æ¸ß´¹¤Ë¤·¤¿¤±¤ì¤Ð¡¢
155 ¥×¥í¥°¥é¥à¤Î½é´ü²½¤Î¸å¤Ë
158 setlocale(LC_ALL, "");
161 ¤ò¸Æ¤Ó½Ð¤·¡¢¥í¥±¡¼¥ë°Í¸¤Î¾ðÊó¤Ë¤Ï
165 ¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤ÎÁàºî¤Ë¤Ï¿¥Ð¥¤¥Èʸ»ú¡¢¥ï¥¤¥Éʸ»ú´Ø¿ô¤ò»ÈÍѤ·¡¢
175 ¤Î¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È¡¢
176 ¤½¤Î¥í¥±¡¼¥ë½¸¹ç¤ËÂбþ¤¹¤ëÆâÉôʸ»úÎó (opaque string) ¤òÊÖ¤¹¡£
177 ¤³¤Îʸ»úÎó¤ÏÀÅŪ¤Êµ²±°è¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
178 ¤³¤ÎÊ֤äÆÍ褿ʸ»úÎó¤ò¡¢¥«¥Æ¥´¥ê»ØÄê¤È¶¦¤Ë¡¢
179 ¤Î¤Á¤Î setlocale ¤Î¸Æ¤Ó½Ð¤·¤Ë»ØÄꤹ¤ì¤Ð¡¢
180 ¥×¥í¥»¥¹¤Î¤½¤ÎÉôʬ¤Î¥í¥±¡¼¥ë¤¬Éü¸µ¤µ¤ì¤ë¡£
181 ÀßÄê¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢ÊÖ¤êÃÍ¤Ï NULL ¤Ë¤Ê¤ë¡£
183 C89, C99, POSIX.1-2001.
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 ¤È»ØÄꤹ¤ë¤À¤±¤Ç
194 ¤ÏÀµ¤·¤¤Åú¤¨¤òÊÖ¤·¤¿¡£
195 ºÇ¶á¤Ç¤Ï¡¢±Ñ¸ì°Ê³°¤ò»È¤¦¥è¡¼¥í¥Ã¥Ñ¿Í¤Ï¤â¤¦¾¯¡¹¤ä¤Ã¤«¤¤¤Êºî¶È¤òɬÍפȤ·¡¢
196 ¼ÂºÝ¤Î¥í¥±¡¼¥ë¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£