« Return to Thread: [ruby-dev:38278] [BUG:1.9] io does not convert str when ext == intern

[ruby-dev:38280] Re: [BUG:1.9] io does not convert str when ext == intern

by sheepman-2 :: Rate this Message:

Reply to Author | View in Thread

こんばんは sheepman です。

On Sun, 5 Apr 2009 22:08:19 +0900
"NARUSE, Yui" <naruse@...> wrote:

> 内部エンコーディングの設定は、書き込み時のエンコーディング変換には影響しません。
> またdefault_externalも、書き込み時のエンコーディング変換には影響しません。

影響しているようです。

$ cat t.rb
# encoding:euc-jp
io = File.open('t.txt', 'w+', { :internal_encoding => "EUC-JP"} )
io.write("ほげ")

$ ruby-1.9 -v -Esjis t.rb
ruby 1.9.2dev (2009-04-04 trunk 23134) [i686-linux]

$ nkf --guess t.txt
Shift_JIS

 « Return to Thread: [ruby-dev:38278] [BUG:1.9] io does not convert str when ext == intern