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

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

by NARUSE, Yui-2 :: Rate this Message:

Reply to Author | View in Thread

成瀬です。

とりあえず先にこちらを。

sheepman wrote:
> こんばんは sheepman です。
>
> IO の外部エンコーディングと内部エンコーディングが等しい場合に、
> 変換が必要な場合でも、変換が起きません。
>
> $ cat t.rb
> # encoding:euc-jp
> io = File.open('t.txt', 'w+', { :internal_encoding => "SJIS" } )
> io.write("ほげ")

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

--
NARUSE, Yui  <naruse@...>

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