Ruby製ã®ãã¼ã«ãæ±ãéã«ããã©ã«ãã¨ã³ã³ã¼ãã£ã³ã°ãUTF-8ãããªãã¦äººçå³ããå ´åããã
ããããã£ããã¨
èªåã使ã£ããããããªããã§ããã©ãcompassã使ãã¨ãã«SASSãã¡ã¤ã«çã¯UTF-8ãªãã ãã©Windowsç°å¢ã§compassã使ã£ã¦ãã«ããããã¨ããã¨ããã©ã«ãã¨ã³ã³ã¼ãã£ã³ã°ã®éãããWindows-31Jãããªããã®ã£ã¼ã¨è¨ãããããã
ä¸è¬çãªããæ¹ã¨åé¿æ¹æ³
å½ç¶ã°ã°ã£ãããã¦ã¿ããã§ããã©ãããããã¨ã¿ã¼ããã«ä¸ã§set LANG=ja_JP.UTF-8ãããç°å¢å¤æ°ã«LANGãç»é²ãã¦ããã°è¯ãã¨æ¸ãã¦ããã ã ãããããã©ããRuby1.9ç³»ã§ã¯ããã§å¯¾å¿ã§ããããããã©ãRuby2.0ç³»ã§ã¯å¯¾å¿ã§ããªãããã ã
追è¨
ã³ã¡ã³ãæ¬ã§æãã¦ãããã¾ããããset RUBYOPT=-EUTF-8ã§ã¨ã³ã³ã¼ãã£ã³ã°ãæå®ããã°è¯ãã®ã§ãã*1ããã£ã¡ã®ã»ããè¯ãæ°ããã¾ãã®ã§ç¶ãã¯èªã¾ãªãã¦è¯ãã§ã!! åèï¼http://doc.ruby-lang.org/ja/2.0.0/doc/spec=2frubycmd.html#cmd_option
æ¤è¨¼
set LANGã§ã®æ¤è¨¼
ããã§ãã¡ã ã£ããã質åãåã®æã«æ¥ãããã§ããã念ã®ãã確èªãã¦ã¿ã¾ãããã
Ruby 1.9.3
UTF-8ã«ãªãã
Ruby2.0.0
UTF-8ã«ãªããªãã
chcpã§ã®æ¤è¨¼
ããããã¿ã¼ããã«ä¸ã®ã¨ã³ã³ã¼ãã£ã³ã°ãå¤æ´ãããªãchcpã使ãå¿ è¦ãããã®ã§ã¯ï¼ã¨æãç«ã¤ã以åã¡ãã£ã¨chcpã使ã£ãäºããã£ãã®ã§æãåºãã ã
chcp 65001
ã¨ãã¦UTF-8ã«ãã¦ã©ããªãã®ãã確èªãããchcpãå®è¡ããã¨ã¿ã¼ããã«ã®è¡¨ç¤ºããªã»ãããããã®ã§ä¸è¨ã¨éãå½¢ã«ãªã£ã¦ãããã©ãæ°ããã¿ã¼ããã«ãç«ã¡ä¸ããªããã¦ããã®ã§ãå®è¡åã¯Windows-31Jã¨è¡¨è¨ããã¦ãããã¨ã確èªãã¦ããã
Ruby 1.9.3
UTF-8ã«ãªã£ãã
Ruby 2.0.0
UTF-8ã«ãªã£ãã
çµè«
chcpã§æåã³ã¼ããå¤ããã¨ãã©ã³ãã®åé¡ãªã©ã§æ¥æ¬èªãåºåã§ããªãæ°ãããã®ã§ãç»é¢ã«ä½ãã表示ãããããªé¡ã®åé¡ã ã£ããããã§ã¯è§£æ±ºã§ããªããããããªã*2ãéã«ãããããäºã§ãå·®ãæ¯ããªããã°chcp 65001
ãã¦ããã®ãè¯ãã¨æãã
ããããã®Windowsãã¹ã¿ã¼çã«ã¯å½ç¶ã®ãã¨ãªãã§ããããããã¾ãæ
å ±ãç¡ãããã«æãã¾ãããä»åã¯ãã¾ãã¾chcpã®åå¨ããã£ã¦ãããããªãã¨ããªã£ããã©ãç¥ããªãã£ãããæä¸ãã ã£ãæ°ããã¾ãâ¦â¦ã
ã©ããã¦ãæ¸ããªãã¦ã¯ãªããªã宣ä¼
æ¸ç±ãåºçãã¾ããã®ã§ãã²ã¨ããè³¼å ¥é ããã°ã¨æãã¾ã!! ããããã話ã§å£²ãè¡ãã¯å¥½èª¿ã®ããã§ããããããããæ¸åºã§è²·ããªã*3ãããããªãã®ã§ãããã§ãããã¨ãã¦ããã¨è¯ãããããã¾ããã
ãã¼ãã§ã¯ãRuby (PERFECT SERIES 6)
- ä½è : Rubyãµãã¼ã¿ã¼ãº,ããããã¾ãã®ã,寺ç°ç太é,ä¸æçé,è¿è¤å®æºæ,æ©ç«åå®,é¢å£äº®ä¸
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2013/08/10
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (3件) ãè¦ã
*1:RUBYOPTã®åå¨ãå®å ¨ã«å¿ãã¦ãã
*2:ã¬ã¸ã¹ããªãããã°äºã ã£ã¦ã®ã¯è¦ããã©ãããã¾ã§ã¯è©¦ãã¦ãªã
*3:ã¿ã¤ãã³ã°ã«ãã£ã¦ã¯ååãã«ãªã£ã¦ãå¯è½æ§ãå¾®ã¬å