ä¸çºã§ããã¹ããã¡ã¤ã«ãèªãæ¹æ³ â 1.9.2ã§File.read(IO.read)ã使ãå ´åã s = File.read("hoge.txt", :encoding => Encoding::UTF_8) ruby 1.9ã§ã¯èªã¿è¾¼ãããã¹ãã®æåã³ã¼ã(:encoding)ããªãã¹ãæ示ãããã¨ã«æ³¨æãæåã³ã¼ããç°ãªãå ´åã¯ãencodeã§ãã®ã¾ã¾å¤æããã®ãããã¨æãã¾ãã â» File.readã®:encodingãæå®ããªãã¨ãencodeã§æååããããã¨ã«ãªããã¨æãã¾ã s = File.read("hoge.txt", :encoding => Encoding::EUC_JP).encode(Encoding::UTF_8) ãã¡ã¤ã«ãã¹ã®æ±ã(ç¸å¯¾ãã¹ã®å±éãªã©)ãèããã¨ãPathname#readã使ãã®ã便å©ã§ãã require 'pathname' s
{{#tags}}- {{label}}
{{/tags}}