Release 3.3J Copyright ã1992 - 1995 by CANON INC.  All Rights Reserved.

Locale¥Ç¡¼¥¿¥Ù¡¼¥¹,
Locale´Ø¿ô¤Ë¤Ä¤¤¤Æ

NEXTSTEP¤Ç»ÈÍÑ¤µ¤ì¤ëlocale¥Ç¡¼¥¿¥Ù¡¼¥¹¤Îµ­½ÒÊýË¡¡¢¸¡º÷¤Î»ÅÊý¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£
¤Þ¤¿¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëlocale´Ø¿ô¤Ë¤Ä¤¤¤Æ¤â°Ê²¼¤Ë½Ò¤Ù¤Þ¤¹¡£

1. Locale¥Ç¡¼¥¿¥Ù¡¼¥¹

NEXTSTEP¤Ïlocaleµ¡Ç½¤ò»ý¤Ã¤Æ¤ª¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¼ÂºÝ¤Ë»ÈÍÑ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£locale¤Î»ÅÍÍ¤Ë¤Ä¤¤¤Æ¤ÏANSI¤Î»ÅÍÍ¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
NEXTSTEP¤Ç¤Ïlocale¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ¡¢/NextApps/Preferences.app/*.lproj/international.strings¤ò»ÈÍÑ¤·¤Þ¤¹¡£Îã¤¨¤ÐÆüËÜ¸ì¤Î¾ì¹ç¡¢/NextApps/Preferences.app/Japanese.lproj/international.strings¤Ë°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

"NXShortDays"   = "Sun Mon Tue Wed Thu Fri Sat";
"NXLongDays"    = "Æü ·î ²Ð ¿å ÌÚ ¶â ÅÚ";
"NXShortMonths" = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec";
"NXLongMonths"  = "\\ 1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\ 7 \\ 8 \\ 9 10 11 12";
"NXAmPm"        = "¸áÁ° ¸á¸å";
"NXDateAndTime" = "%YÇ¯%m·î%dÆü(%A) %H»þ%MÊ¬%SÉÃ %Z";
"NXDate"        = "%a %b %d %Y";
"NXTime"        = "%H:%M:%S %Z";

2. Locale ¥é¥¤¥Ö¥é¥ê´Ø¿ô
¤Þ¤¿¡¢NeXT¤Ç¤Ïlocaleµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤¹¤ë°Ù¼¡¤Î3¤Ä¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬Äó¶¡¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

setlocale - ¼Â¹Ô»þ¤ÎÃÏ°è´Ä¶­¤ÎÀßÄê¤ª¤è¤ÓÌä¤¤¹ç¤ï¤»
localeconv - ¿ôÎÌ·Á¼°¤ÎÀßÄê
strftime - ÆüÉÕ¤È»þ¹ï¤Î½ÐÎÏ·Á¼°ÊÑ´¹

°Ê²¼¤Ë¤³¤ì¤é¤Î´Ø¿ô¤Î¾ÜºÙ¤ò½Ò¤Ù¤Þ¤¹¡£

	2-1	setlocale

[·Á¼°]
#include <locale.h>

char *setlocale(int category, const char *locale);

[µ¡Ç½ÀâÌÀ]
setlocale ¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÃÏ°è´Ä¶­¤òÅ¬Åö¤ÊÈÏ°Ï¤Ë³ä¤êÅö¤Æ¤Þ¤¹¡£ ³ä¤êÅö¤Æ¤Ï¡¢°ú¿ô¤Î category ¤È locale ¤Ë¤è¤Ã¤ÆÆÃÄê¤µ¤ì¤Þ¤¹¡£
setlocale ´Ø¿ô¤Ï¡¢¥×¥í¥°¥é¥à¤Î¸½ºßÃÏ°è (current locale)¤ÎÈÏ°Ï¤òÊÑ¹¹¤·¤¿¤êÌä¤¤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤Î¤Ë»ÈÍÑ¤µ¤ì¤Þ¤¹¡£

category ¤Î»ØÄê

»ÈÍÑ¤Ç¤­¤ë category ¤ÎÃÍ¤Ï¡¢LC_MONETARY¡¢LC_NUMERIC¡¢LC_TIME ¤Ç¤¹¡£¤³¤ì¤é¤Ï¡¢¤¹¤Ù¤Æ¥×¥í¥°¥é¥à¤ÎÃÏ°è´Ä¶­¤Î°ìÉôÊ¬¤òÉ½¤·¤Æ¤¤¤Þ¤¹¡£
¥×¥í¥°¥é¥à¤ÎÃÏ°è´Ä¶­¤ÎÁ´ÂÎ¤òÉ½¤¹ LC_ALL ¤Ï¡¢¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£¤Þ¤¿¡¢LC_CTYPE¡¢LC_COLLATE ¤â¡¢¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£

LC_MONETARY ¤Ï¡¢(localeconv ´Ø¿ô¤ÎÊÖ¤¹¹½Â¤ÂÎ lconv ¾ðÊó¤Î) ÄÌ²ß¤Ë´Ø¤¹¤ë½ñ¼°¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤¹¡£
(¹½Â¤ÂÎ lconv ¤Ï¡¢locale.h ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£)

±Æ¶Á¤òÍ¿¤¨¤ë½ñ¼°¤Ï¡¢(localeconv ´Ø¿ô¤ÎÊÖ¤¹) ¹½Â¤ÂÎ lconv ¤Î¼¡¤Î¥á¥ó¥Ð¤Ç¤¹¡£

char *int_curr_symbol;	/* INTernational CURRency SYMBOL */
char *currency_symbol;	/* CURRENCY SYMBOL */
char *mon_decimal_point;	/* MONetary DECIMAL POINT */
char *mon_thousands_sep;	/* MONetary THOUSANDS SEParate */
char *mon_grouping;	/* MONetary GROUPING */
char *positive_sign;	/* POSITIVE SIGN */
char *negative_sign;	/* NEGATIVE SIGN */
char p_cs_precedes;	/* Positive CurrencySymbol PRECEDES */
char p_sep_by_space;	/* Positive SEParated BY a SPACE */
char n_cs_precedes;	/* Negative CurrencySymbol PRECEDES */
char n_sep_by_space;	/* Negative SEPearted BY a SPACE */
char p_sign_posn;	/* Positive SIGN POSitioN */
char n_sign_posn;	/* Negative SIGN POSitioN */

¤Ç¤¹¡£

LC_NUMERIC ¤Ï¡¢½ñ¼°Æþ½ÐÎÏ´Ø¿ô¤ÈÊ¸»úÎóÊÑ´¹´Ø¿ô¤Î¾®¿ôÅÀÊ¸»ú¡¢¤ª¤è¤Ó(localeconv ´Ø¿ô¤ÎÊÖ¤¹¾ðÊó¤Î)ÄÌ²ß¤Ë´Ø·¸¤·¤Ê¤¤½ñ¼°¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤¹¡£±Æ¶Á¤òÍ¿¤¨¤ë½ñ¼°¤Ï¡¢(localeconv ´Ø¿ô¤ÎÊÖ¤¹) ¹½Â¤ÂÎ lconv ¤Î¼¡¤Î¥á¥ó¥Ð¤Ç¤¹¡£

char *decimal_point;	/* DECIMAL POINT */
char *thousands_sep;	/* THOUSANDS SEParate */
char *grouping;	/* GROUPING */
char int_frac_digits;	/* INTernational FRACtional DIGITS */
char frac_digits;	/* FRACtional DIGITS */

LC_TIME ¤Ï¡¢strftime ´Ø¿ô¤ÎÆ°ºî¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤¹¡£

locale ¤Î»ØÄê

locale ¤Ë "C" ¤ò»ØÄê¤¹¤ë¤È¡¢C ¸À¸ì¤ÎºÇ¾®´Ä¶­¤¬ÀßÄê¤µ¤ì¤Þ¤¹¡£
locale ¤Ë "" ¤ò»ØÄê¤¹¤ë¤È¡¢½èÍý·ÏÄêµÁ¤Î¹ñÆâ´Ä¶­(native environment)¤¬ÀßÄê¤µ¤ì¤Þ¤¹¡£(¸å½Ò)

¹ñÆâ´Ä¶­¤ÎÀßÄê

locale ¤Ë "" ¤ò»ØÄê¤¹¤ë¤È¡¢½èÍý·ÏÄêµÁ¤Î¹ñÆâ´Ä¶­¤¬ÀßÄê¤µ¤ì¤Þ¤¹¡£¹ñÆâ´Ä¶­¤ÎÀßÄê¤Ë¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤¿¡¢¥ª¡¼¥Ê¡¼GLOBAL ¤ÎÊÑ¿ô NXAmPm¡¢NXDate¡¢NXDateAndTime¡¢NXLongDays¡¢NXLongMonths¡¢NXShortDays¡¢NXShortMonths¡¢NXTime¡¢NXNumberGroup¡¢NXCurrencyGroup¡¢NXCurrencyFormat¤ÎÃÍ¤¬»ÈÍÑ¤µ¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î´Ä¶­ÊÑ¿ô¤¬ÀßÄê¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢C ¸À¸ì¤ÎºÇ¾®´Ä¶­¤¬»ÈÍÑ¤µ¤ì¤Þ¤¹¡£
¹ñÆâ´Ä¶­¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤¿¡¢¥ª¡¼¥Ê¡¼System ¤ÎÊÑ¿ô Language ¤ÎÃÍ¤Ç¤¹¡£

½èÍý·Ï¤Ï¡¢¤¢¤¿¤«¤â¤É¤Î¥é¥¤¥Ö¥é¥ê¤â setlocale ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ê¤¤¤«¤Î¤è¤¦¤ËºîÆ°¤·¤Þ¤¹¡£

[¥Õ¥¡¥¤¥ë]
/NextApps/Preferences.app/*.lproj	ÃÏ°è´Ä¶­¥Ç¥£¥ì¥¯¥È¥ê
/NextApps/Preferences.app/*.lproj/international.strings	ÃÏ°è´Ä¶­¥Õ¥¡¥¤¥ë
/NextDeveloper/Headers/ansi/locale.h	¹½Â¤ÂÎ lconv ÄêµÁ¥Ø¥Ã¥À
     
[´ØÏ¢¹àÌÜ]
date(1), dread(1), dremove(1), dwrite(1), strftime(3)
ANSI X3.159-1989

[Ìá¤êÃÍ]
locale ¤ËÊ¸»úÎó¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤ò»ØÄê¤·¡¢ÁªÂò¤¬À®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¿·¤·¤¤ÃÏ°è´Ä¶­¤Î category ¤Ë´ØÏ¢¤¹¤ëÊ¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£

ÁªÂò¤¬À®¸ù¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ì¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢¥×¥í¥°¥é¥à¤ÎÃÏ°è´Ä¶­¤ÏÊÑ¤ï¤ê¤Þ¤»¤ó¡£

locale ¤Ë¥Ì¥ë¥Ý¥¤¥ó¥¿¤ò»ØÄê¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î¸½ºßÃÏ°è(current locale) ¤Î category ¤Ë´ØÏ¢¤¹¤ëÊ¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢¥×¥í¥°¥é¥à¤ÎÃÏ°è´Ä¶­¤ÏÊÑ¤ï¤ê¤Þ¤»¤ó¡£

setlocale ¤ÎÊÖ¤¹¥Ý¥¤¥ó¥¿¤¬»Ø¤¹Ê¸»úÎó¤ò¥×¥í¥°¥é¥à¤ÎÃæ¤ÇÊÑ¹¹¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

2-2 localeconv

[·Á¼°]
#include <locale.h>

struct lconv *localeconv(void);

[µ¡Ç½ÀâÌÀ]
localeconv ´Ø¿ô¤Ï¡¢struct lconv ·¿¥ª¥Ö¥¸¥§¥¯¥È¤ÎÍ×ÁÇ¤òÀßÄê¤·¤Þ¤¹¡£struct lconv ·¿¥ª¥Ö¥¸¥§¥¯¥È¤ÎÍ×ÁÇ¤ÎÃÍ¤Ï¡¢¿ôÎÌ·Á¼°(ÄÌ²ß¤Ê¤É)¤Î½ñ¼°¤òÄêµÁ¤·¤Þ¤¹¡£ÀßÄê¤Ï¡¢¸½ºßÃÏ°è(current locale)¤Îµ¬Äê¤Ë½¾¤Ã¤Æ¤ª¤³¤Ê¤ï¤ì¤Þ¤¹¡£
¹½Â¤ÂÎ lconv ¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë locale.h ¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

struct lconv {
    char *decimal_point;        /* DECIMAL POINT */
    char *thousands_sep;        /* THOUSANDS SEParate  */
    char *grouping;             /* GROUPING */  
    char *int_curr_symbol;      /* INTernational CURRency SYMBOL */
    char *currency_symbol;      /* CURRENCY SYMBOL */
    char *mon_decimal_point;    /* MONetary DECIMAL POINT */
    char *mon_thousands_sep;    /* MONetary THOUSANDS SEParate */
    char *mon_grouping;         /* MONetary GROUPING */ 
    char *positive_sign;        /* POSITIVE SIGN */
    char *negative_sign;        /* NEGATIVE SIGN */
    char int_frac_digits;       /* INTernational FRACtional DIGITS */
    char frac_digits;           /* FRACtional DIGITS */ 
    char p_cs_precedes;         /* Positive CurrencySymbol PRECEDES */  
    char p_sep_by_space;        /* Positive SEPearted BY a SPACE */
    char n_cs_precedes;         /* Negative CurrencySymbol PRECEDES */  
    char n_sep_by_space;        /* Negative SEPearted BY a SPACE */
    char p_sign_posn;           /* Positive SIGN POSitioN */    
    char n_sign_posn;           /* Negative SIGN POSitioN */    
};

lconv ¹½Â¤ÂÎ¤Î char * ·¿¤Î¥á¥ó¥Ð¤Ï¡¢Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢(decimal_point ¤ò½ü¤¤¤Æ) "" ¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£"" ¤Ë»ØÄê¤¹¤ë¤È¡¢¤½¤ÎÃÍ¤¬¸½ºßÃÏ°è¤ÇÅ¬ÍÑÉÔÇ½¤Þ¤¿¤Ï¤½¤ÎÃÍ¤ÎÄ¹¤µ¤¬Îí¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
char ·¿¤Î¥á¥ó¥Ð¤Ï¡¢Éé¤Ç¤Ê¤¤¿ô¤Ç¡¢CHAR_MAX ¤Ë»ØÄê¤Ç¤­¤Þ¤¹¡£
CHAR_MAX ¤Ë»ØÄê¤¹¤ë¤È¡¢¤½¤ÎÃÍ¤¬¸½ºßÃÏ°è¤ÇÅ¬ÍÑÉÔÇ½¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
CHAR_MAX ¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë limits.h ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

grouping ¤È mon_grouping ¤ÎÍ×ÁÇ¤Ï¡¢¼¡¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤Þ¤¹¡£¡¡

CHAR_MAX	¤½¤ì°Ê¸å¤Î°Ì¼è¤ê¤Ï¤ª¤³¤Ê¤ï¤ì¤Ê¤¤¡£

0	¤½¤ì°ÊÁ°¤ÎÍ×ÁÇ¤¬¤½¤ì°Ê¸å¤Ë·«¤êÊÖ¤·ÍÑ¤¤¤é¤ì¤ë¡£

¤½¤ÎÂ¾	À°¿ôÃÍ¤Ï¸½ºß¤Î°Ì¼è¤ê·å¿ô¤Ç¤¹¡£¤½¤Î¼¡¤ÎÍ×ÁÇ¤Ï¡¢¸½ºß¤Î·å¤è¤ê¾å°Ì¤Î°Ì¼è¤ê·å¿ô¤ò·èÄê¤¹¤ë¤¿¤á¤Ë¡¢¸½ºß¤Î·å¿ô¤ò·èÄê¤¹¤ëÁ°¤ËÄ´ºº¤µ¤ì¤Þ¤¹¡£

p_sign_posn ¤È n_sign_posn ¤ÎÃÍ¤Ï¡¢¼¡¤Î¤è¤¦¤Ë²ò¼á¤µ¤ì¤Þ¤¹¡£¡¡

0	ÄÌ²ßÎÌ¡¢ÄÌ²ßµ­¹æ¤ò³ç¸Ì¤Ç°Ï¤à¡£

1	Éä¹æÊ¸»úÎó¤Ï¡¢ÄÌ²ßÎÌ¡¢ÄÌ²ßµ­¹æ¤ÎÁ°¤Ë°ÌÃÖ¤¹¤ë¡£ 

2	Éä¹æÊ¸»úÎó¤Ï¡¢ÄÌ²ßÎÌ¡¢ÄÌ²ßµ­¹æ¤Î¸å¤Ë°ÌÃÖ¤¹¤ë¡£ 

3	Éä¹æÊ¸»úÎó¤Ï¡¢ÄÌ²ßµ­¹æ¤ÎÄ¾Á°¤Ë°ÌÃÖ¤¹¤ë¡£ 

4	Éä¹æÊ¸»úÎó¤Ï¡¢ÄÌ²ßµ­¹æ¤ÎÄ¾¸å¤Ë°ÌÃÖ¤¹¤ë¡£ 

lconv ¹½Â¤ÂÎ¤Î¥á¥ó¥Ð¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

char *decimal_point
Èó²ßÊ¾ÎÌ¤ËÍÑ¤¤¤é¤ì¤ë¾®¿ôÅÀÊ¸»ú(decimal-point character)¡£

char *thousands_sep
Èó²ßÊ¾ÎÌ¤Î¾®¿ôÅÀÊ¸»ú¤ÎÁ°¤Î¿ô»ú¤ò¡¢3·å¤´¤È¤Ë¶èÀÚ¤ë¤¿¤á¤ËÍÑ¤¤¤é¤ì¤ëÊ¸»ú(thousands separate character)¡£

char *grouping
Èó²ßÊ¾ÎÌ¤Î¶èÀÚ¤é¤ì¤¿¿ô»ú¤Î¥°¥ë¡¼¥×¥µ¥¤¥º(·å¿ô)¤ò¼¨¤¹Ê¸»úÎó¡£

char *int_curr_symbol
¸½ºßÃÏ°è¤ÇÅ¬ÍÑ¤µ¤ì¤ë¹ñºÝÄÌ²ßµ­¹æ(international currency symbol)¡£ºÇ½é¤Î3Ê¸»ú¤Ï¡¢¡ÖÄÌ²ß¤ª¤è¤Ó¹ñºÄ¤ÎÉ½µ­ÊýË¡¤òÄê¤á¤ë ISO 4217 ¥³¡¼¥É¡×(ISO 4217 Codes for the Representation of Currency and Funds)¤Ë½¾¤¦¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î¹ñºÝÄÌ²ßµ­¹æ¤«¤éÀ®¤ê¤Þ¤¹¡£
4ÈÖÌÜ¤ÎÊ¸»ú¤Ï¡¢¹ñºÝÄÌ²ßµ­¹æ¤È²ßÊ¾ÎÌ¤òÊ¬Î¥¤¹¤ë¤¿¤á¤Ë»ÈÍÑ¤µ¤ì¤ëÊ¸»ú¤Ç¤¹¡£(¥Ì¥ëÊ¸»ú¤ÎÄ¾Á°¤ËÃÖ¤«¤ì¤Þ¤¹¡£)

char *currency_symbol
¸½ºßÃÏ°è¤ÇÅ¬ÍÑ¤µ¤ì¤ëÃÏ°èÄÌ²ßµ­¹æ(local currency symbol)¡£

char *mon_decimal_point
²ßÊ¾ÎÌ¤ËÍÑ¤¤¤é¤ì¤ë¾®¿ôÅÀÊ¸»ú(decimal-point character)¡£

char *mon_thousands_sep
²ßÊ¾ÎÌ¤Î¾®¿ôÅÀÊ¸»ú¤ÎÁ°¤Î¿ô»ú¤ò¡¢3·å¤´¤È¤Ë¶èÀÚ¤ë¤¿¤á¤ËÍÑ¤¤¤é¤ì¤ëÊ¸»ú(thousands separate character)¡£

char *mon_grouping
²ßÊ¾ÎÌ¤Î¶èÀÚ¤é¤ì¤¿¿ô»ú¤Î¥°¥ë¡¼¥×¥µ¥¤¥º(·å¿ô)¤ò¼¨¤¹Ê¸»úÎó¡£

char *positive_sign
ÈóÉéÃÍ²ßÊ¾ÎÌ¤ò¼¨¤¹Ê¸»úÎó¡£

char *negative_sign
ÀµÃÍ²ßÊ¾ÎÌ¤ò¼¨¤¹Ê¸»úÎó¡£

char int_frac_digits
¹ñºÝ²ßÊ¾ÎÌ¤ÇÍÑ¤¤¤é¤ì¤ë(¾®¿ôÅÀÊ¸»ú¤Î¸å¤Î)¾®¿ô·å¿ô(international fractional digits)¡£

char frac_digits
²ßÊ¾ÎÌ¤ÇÍÑ¤¤¤é¤ì¤ë(¾®¿ôÅÀÊ¸»ú¤Î¸å¤Î)¾®¿ô·å¿ô(fractional digits)¡£

char p_cs_precedes
ÈóÉéÃÍ²ßÊ¾ÎÌ¤ÇÄÌ²ßµ­¹æ¤¬¿ôÃÍ¤ËÀè¹Ô¤¹¤ë¤È¤­1¡¢¸åÂ³¤¹¤ë¤È¤­0¤ËÀßÄê¡£

char p_sep_by_space
ÈóÉéÃÍ²ßÊ¾ÎÌ¤ÇÄÌ²ßµ­¹æ¤È¿ôÃÍ¤¬¶õÇòÊ¸»ú¤ÇÊ¬Î¥¤µ¤ì¤ë¤È¤­1¡¢¤µ¤ì¤Ê¤¤¤È¤­0¤ËÀßÄê¡£

char n_cs_precedes
ÉéÃÍ²ßÊ¾ÎÌ¤ÇÄÌ²ßµ­¹æ¤¬¿ôÃÍ¤ËÀè¹Ô¤¹¤ë¤È¤­1¡¢¸åÂ³¤¹¤ë¤È¤­0¤ËÀßÄê¡£

char n_sep_by_space
ÉéÃÍ²ßÊ¾ÎÌ¤ÇÄÌ²ßµ­¹æ¤È¿ôÃÍ¤¬¶õÇòÊ¸»ú¤ÇÊ¬Î¥¤µ¤ì¤ë¤È¤­1¡¢¤µ¤ì¤Ê¤¤¤È¤­0¤ËÀßÄê¡£

char p_sign_posn
ÈóÉéÃÍ²ßÊ¾ÎÌ¤ÇÀµÉä¹æÊ¸»ú(positive_sign)¤Î°ÌÃÖ¤ò¼¨¤¹ÃÍ¤òÀßÄê¡£

char n_sign_posn
ÉéÃÍ²ßÊ¾ÎÌ¤ÇÉéÉä¹æÊ¸»ú(negative_sign)¤Î°ÌÃÖ¤ò¼¨¤¹ÃÍ¤òÀßÄê¡£½èÍý·Ï¤Ï¡¢¤¢¤¿¤«¤â¤É¤Î¥é¥¤¥Ö¥é¥ê¤âlocaleconv¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ê¤¤¤«¤Î¤è¤¦¤ËºîÆ°¤·¤Þ¤¹¡£

[»ÈÍÑÎã]
¼¡¤ÎÉ½¤Ï¡¢³Æ¹ñ¤ÇÍÑ¤¤¤é¤ì¤Æ¤¤¤ëÄÌ²ßÎÌ½ñ¼°¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£

¹ñÌ¾	ÀµÃÍ½ñ¼°	ÉéÃÍ½ñ¼°	¹ñºÝ½ñ¼°

Italy	L.1.234	-L.1.234	ITL.1.234
Japan	¡ï1,234	¡ï-1,234	JPY 1,234
Netherlands	F 1.234,56	F -1.234,56	NLG 1.234,56
Norway	kr1.234,56	kr1.234,56	NOK 1.234,56
Switzerland	SFrs.1,234.56	SFrs.1,234.56C	CHF 1,234.56

localeconv ¤¬ÊÖ¤¹¹½Â¤ÂÎ¤ÎÄÌ²ß¥á¥ó¥Ð¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

Italy	Japan	Netherlands	Norway	Switzerland 

int_curr_symbol	"ITL."	"JPY "	"NLG "	"NOK "	"CHF "
currency_symbol	"L."	"¡ï"	"F"	"kr"	"SFrs."
mon_decimal_point	""	""	","	","	"."
mon_thousands_sep	"."	","	"."	"."	","
mon_grouping	"\3"	"\3"	"\3"	"\3"	"\3"
positive_sign	""	""	""	""	""
negative_sign	"-"	"-"	"-"	"-"	"C"
int_frac_digits	0	0	2	2	2
frac_digits	0	0	2	2	2
p_cs_precedes	1	1	1	1	1
p_sep_by_space	0	0	1	0	0
n_cs_precedes	1	1	1	1	1
n_sep_by_space	0	0	1	0	0
p_sign_posn	1	1	1	1	1
n_sign_posn	1	4	4	2	2

[Ìá¤êÃÍ]
localeconv ¤Ï¡¢lconv ¹½Â¤ÂÎ¤ËÃÏ°è´Ä¶­¤ÎÃÍ¤òÀßÄê¤·¡¢ lconv ¹½Â¤ÂÎ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£

localeconv ¤ÎÊÖ¤¹¥Ý¥¤¥ó¥¿¤¬»Ø¤¹¹½Â¤ÂÎ¤ò¥×¥í¥°¥é¥à¤ÎÃæ¤ÇÊÑ¹¹¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£¤¿¤À¤·¡¢localeconv ´Ø¿ô¤òºÆÅÙ¸Æ¤Ó½Ð¤·¤Æ¾å½ñ¤­¤¹¤ë¾ì¹ç¤Ï½ü¤­¤Þ¤¹¡£

¤µ¤é¤Ë¡¢ setlocale ´Ø¿ô¤ò category °ú¿ô LC_MONETARY¡¢LC_NUMERIC ¤Ç¸Æ¤Ó½Ð¤¹¤È¹½Â¤ÂÎ¤ÎÆâÍÆ¤¬¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£

[¥Õ¥¡¥¤¥ë]
/NextApps/Preferences.app/*.lproj	ÃÏ°è´Ä¶­¥Ç¥£¥ì¥¯¥È¥ê
/NextApps/Preferences.app/*.lproj/international.strings	ÃÏ°è´Ä¶­¥Õ¥¡¥¤¥ë
/NextDeveloper/Headers/ansi/locale.h	¹½Â¤ÂÎ lconv ÄêµÁ¥Ø¥Ã¥À
     
[´ØÏ¢¹àÌÜ]
date(1), dread(1), dremove(1), dwrite(1), strftime(3)
ANSI X3.159-1989

2-3  strftime

[·Á¼°]
#include <time.h>

size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr);

[µ¡Ç½ÀâÌÀ]
strftime ¤Ï¡¢tm ¹½Â¤ÂÎ¤ò»Ø¤¹¥Ý¥¤¥ó¥¿ timeptr ¤ò¼è¤ê½Ð¤·¡¢½ñ¼°Ê¸»úÎóformat ¤Ç»ØÄê¤·¤¿·Á¼°¤ÎÊ¸»úÎó¤ËÊÑ´¹¤·¤Þ¤¹¡£ÊÑ´¹¸å¤ÎÊ¸»úÎó¤Ï¡¢Ê¸»úÇÛÎó s ¤Ë¡¢ºÇÂç maxsize ¤Î¥Ð¥¤¥È¿ô¤Þ¤Ç³ÊÇ¼¤µ¤ì¤Þ¤¹¡£

format ¤¬¡¢¥Þ¥ë¥Á¥Ð¥¤¥ÈÊ¸»ú¤ò´Þ¤à¾ì¹ç¤Ï¡¢¤½¤ÎÁ°¸å¤¬½é´ü¥·¥Õ¥È¾õÂÖ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£format Ê¸»úÎó¤Ï¡¢ÊÑ´¹»ØÄê»Ò(conversion specifier)¤ÈÄÌ¾ï¤Î¥Æ¥­¥¹¥ÈÊ¸»ú¤«¤é¹½À®¤µ¤ì¤Þ¤¹¡£ÊÑ´¹»ØÄê»Ò¤Ï¡¢ÊÑ´¹»ØÄêÊ¸»ú % ¤ÈÊÑ´¹¼ïÊ¸»ú¤«¤é¹½À®¤µ¤ì¤Þ¤¹¡£ÄÌ¾ï¤Î¥Æ¥­¥¹¥ÈÊ¸»ú(½ªÎ»¤ò¼¨¤¹¥Ì¥ëÊ¸»ú¤ò´Þ¤à)¤Ï¡¢¤¹¤Ù¤ÆÌµÊÑ´¹¤ÇÊ£¼Ì¤µ¤ì¤Þ¤¹¡£Ê£¼Ì¤ÎºÝ¤Ë¡¢Ê£¼Ì¸µ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ÈÊ£¼ÌÀè¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬¥ª¡¼¥Ð¡¼¥é¥Ã¥×¤¹¤ë¾ì¹ç¤ÎÆ°ºî¤Ï¡¢Ì¤ÄêµÁ¤Ç¤¹¡£maxsize ¤ò±Û¤¨¤ëÊ¸»úÎó¤Ï¡¢ÇÛÎó¤Ë³ÊÇ¼¤µ¤ì¤Þ¤»¤ó¡£

ÊÑ´¹¤µ¤ì¤ëÊ¸»úÎó¤Ï¡¢¸½ºßÃÏ°è¤Î LC_TIME ¥«¥Æ¥´¥ê¤ª¤è¤Ó timeptr ¤Î»Ø¤·¼¨¤¹¹½Â¤ÂÎ¤Ë¤è¤ê·èÄê¤µ¤ì¤Þ¤¹¡£

ÊÑ´¹»ØÄê»Ò¤ÈÊÑ´¹¤µ¤ì¤ëÊ¸»úÎó¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

%a	ÍËÆü¤ÎÎ¬¸ì
%A	ÍËÆü¤ÎÌ¾Á°
%b	·î¤ÎÎ¬¸ì
%B	·î¤ÎÌ¾Á°
%c	ÆüÉÕ¤È»þ¹ï
%d	ÆüÉÕ	(01-31)
%H	24»þ´ÖÀ©¤Î»þ´Ö	(00-23)
%I	12»þ´ÖÀ©¤Î»þ´Ö	(00-12)
%j	Ç¯¤ÎÄÌ»»Æü	(001-366)
%m	·î	(01-12)
%M	Ê¬	(00-59)
%p	¸áÁ°/¸á¸å
%S	ÉÃ	(00-61)
%U	Ç¯¤ÎÄÌ»»½µ(ÆüÍË¤¬½µ¤Î½é¤á)	(00-53)
%w	ÍËÆü(ÆüÍË¤¬0)	(0-6)
%W	Ç¯¤ÎÄÌ»»½µ(·îÍË¤¬½µ¤Î½é¤á)	(00-53)
%x	ÆüÉÕ
%X	»þ¹ï
%y	À¾ÎñÇ¯¤Î²¼2·å	(00-99)
%Y	À¾ÎñÇ¯
%Z	»þ´ÖÂÓ¤ÎÌ¾
%%	%µ­¹æ¤½¤Î¤â¤Î

ÊÑ´¹»ØÄêÊ¸»ú % ¤ËÂ³¤¯ÊÑ´¹¼ïÊ¸»ú¤¬¡¢¾åµ­°Ê³°¤Î¾ì¹ç¤ÎÆ°ºî¤Ï¡¢Ì¤ÄêµÁ¤Ç¤¹¡£¡¡

[¥Õ¥¡¥¤¥ë]
/NextApps/Preferences.app/*.lproj	ÃÏ°è´Ä¶­¥Ç¥£¥ì¥¯¥È¥ê
/NextApps/Preferences.app/*.lproj/international.strings	ÃÏ°è´Ä¶­¥Õ¥¡¥¤¥ë
/NextDeveloper/Headers/ansi/locale.h	LC_TIME ÄêµÁ¥Ø¥Ã¥À
     
[´ØÏ¢¹àÌÜ]
date(1), dread(1), dremove(1), dwrite(1), gettimeofday(2), getenv(3), time(3), tzfile(5), environ(7)
ANSI X3.159-1989

[Ìá¤êÃÍ]
ÊÑ´¹¸å¤ÎÊ¸»úÎó¤Î¥Ð¥¤¥È¿ô(½ªÎ»¤ò¼¨¤¹¥Ì¥ëÊ¸»ú¤ò´Þ¤à)¤¬¡¢maxsize ¤ò±Û¤¨¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ì¥ëÊ¸»úÎó¤ò´Þ¤Þ¤Ê¤¤¥Ð¥¤¥È¿ô¤òÊÖ¤·¤Þ¤¹¡£
±Û¤¨¤¿¾ì¹ç¤Ï¡¢0 ¤òÊÖ¤·¡¢s ¤Î»Ø¤¹ÇÛÎó¤ÎÆâÍÆ¤Ï¡¢ÉÔÄê¤Ë¤Ê¤ê¤Þ¤¹¡£