æåã³ã¼ãå¤æ
Ruby ã«éããã ã¨æããã©ã以ä¸ã®ããã«ãâæ³¢ããã·ã¥âãâå
¨è§ããã·ã¥âã®ãããªæåã NKF ã§UTF-8 ã«ã¨ã³ã³ã¼ãããéã«æååãããã
ç°å¢ã¨ãã¦ã¯ãå
¥åæå㯠Windows ã§å
¥åãããã°ã©ã ã®å®è¡ã¯ Solaris 10 ã§è¡ã£ã¦ãã
require 'nkf' puts NKF.nkf('-w', 'â')
ãã㧠NKF ã®ãªãã·ã§ã³ã® --cp932 ã追å ããã¨ãã¾ãè¡ãã
require 'nkf' puts NKF.nkf('-w --cp932', 'â')
ããã£ã¦SJIS(å®æ
ã¯MS932)ã UTF-8 ã«å¤æããã¨ãã®ã³ã¼ããã¤ã³ãã®ãããã³ã°ã«åé¡ãããããã ãã©ãä¾ãã°ä¸è¨ã®ã¹ã¯ãªãããè¨è¿°ãããã¡ã¤ã«ã®ã¨ã³ã³ã¼ããSJIS ã§ä¿åããå ´åã§ã¯ãªãã UTF-8 ã§ä¿åãã¦ããå®è¡ãã¦ãããã¯ã --cp932 ãç¡ãã¨æ£ããã¨ã³ã³ã¼ããããªã*1ã
ããã¯ãã£ããã©ããããã¨ã ããã
ãµã¤ã(http://ja.wikipedia.org/wiki/%E6%B3%A2%E3%83%80%E3%83%83%E3%82%B7%E3%83%A5ãªã©)ãããã¤ãè¦ã¦ã¿ããã ãã©ãä¸è¨ã®ããã«ãMS932âUTF-8 ã UTF-8 â UTF-8 ã§é§ç®ãªçç±ãããããããªãã
ã£ã¦ããããæååãé¢é£ã¯ãããããããããããã©ãã§ãããããUTF-8ã«çµ±ä¸ããããï¼ï¼
*1:Windowsã§ãã¡ã¤ã«ãä½æããå ´åã®è©±