ã³ãã³ãããã³ããã§UTF-8ã®æåã表示ãã
ãã®æ¹æ³ã§ã¯æåãæ£ããæç»ã§ããªãããã§ãã(maeyanさんの記事)ã
ããããã®ç°å¢ã§ãé§ç®ã§ããã
æé
- ã³ãã³ãããã³ããã®ãã©ã³ãã®å¤æ´
- ã³ãã³ãããã³ããã®æåã³ã¼ãã®å¤æ´
- ã·ã§ã¼ãã«ããããæåã³ã¼ãã®èªåè¨å®ãè¡ãã
Windowsã®ãã¼ã¸ã§ã³
ãWindows XP Home Edition Version 2002 Service Pack 2 ã§è¡ãã¾ããã
1. ã³ãã³ãããã³ããã®ãã©ã³ãã®å¤æ´
ã³ãã³ãããã³ãããç«ã¡ä¸ããâã¿ã¤ãã«ãã¼å³ã¯ãªãã¯
âããããã£âãã©ã³ããã"MS ã´ã·ãã¯"ãé¸æããã
ããã©ã³ãã"MS ã´ã·ãã¯"ã«å¤æ´ãã¾ããMS ã´ã·ãã¯ã¯ãUnicodeã«å¯¾å¿ãããã¹ã¦ã®æåãæ£ãã表示ã§ããããã§ã¯ãªãã§ãããä¸å¿ã¦ãã³ã¼ãã«å¯¾å¿ãã¦ãã¾ããæ¥æ¬èªã飾ãæåãå«ãæåã表示ãããã¨ãã§ãã¾ãã
2. ã³ãã³ãããã³ããã®æåã³ã¼ãã®å¤æ´
# UTF-8ã«å¤æ´ chcp 65001 # å ã®æåã³ã¼ã( ããã©ã«ã ) ã«æ»ãã¨ã chcp 932 # æåã³ã¼ãã確èªããã¨ã chcp
ãã³ãã³ãããã³ããã®æåã³ã¼ããUTF-8ã«å¤æ´ããã«ã¯ãchcp 65001 ã¨ãã¾ãããã®ã¢ã¼ãå¤æ´ã«ã¯ãã°ãããããã§ãããããã£ããã³ãã³ãããã³ããã®è¨å®ãè¡ããã¨ãã§ããªããªãã¾ã(MS ã´ã·ãã¯ãé¸æã§ããªã)ã
ãããããã£ããã³ãã³ãããã³ããã®è¨å®ãå¤æ´ããã«ã¯ãchcp 932 ã¨ãã¦å ã®æåã³ã¼ãã«ãã£ããæ»ã£ã¦ããå¤æ´ãå ãã¾ãã
3. ã·ã§ã¼ãã«ããããæåã³ã¼ãã®èªåè¨å®ãè¡ã
ã³ãã³ãããã³ããã®ã·ã§ã¼ãã«ããã®ã¢ã¤ã³ã³ãå³ã¯ãªãã¯âã·ã§ã¼ãã«ãã ãªã³ã¯å ã %SystemRoot%\system32\cmd.exe /f:on /k "chcp 65001" ã«è¨å®ã
ãæ¯åæåã³ã¼ããå¤æ´ããã®ãé¢åãªã¨ãã¯èªååãã¾ãã/k ã¯ãã³ãã³ãããã³ããã¨å®è¡æã«ãå®è¡ãããã³ãã³ããè¨è¿°ãã¾ãã /f:on ã¯ããã¡ã¤ã«ã®è£å®æ©è½ã§ãã