From: sheepman Date: 2009-05-04T15:08:18+09:00 Subject: [ruby-dev:38368] IO.copy_stream doesn't convert encodings こんにちは sheepman です。 毎度細かいことで恐縮ですが。 エンコーディングを指定して open した IO オブジェクトを与えても、 IO.copy_stream がエンコーディングを変換しません。 これは、こういうものでしょうか。 $ cat t.rb # coding:euc-jp i = File.open('i.txt', 'r:euc-jp') o = File.open('o.txt', 'w:sjis') IO.copy_stream(i, o) $ cat i.txt 漢字 $ ruby-1.9 -v t.rb ruby 1.9.2dev (2009-05-02 trunk 23326) [i686-linux] $ nkf --guess o.txt EUC-JP