[ruby-trunk - Bug #6071][Open] [Windows] exception in Dir.open doesn't respect the encoding of its a

Issue #6071 has been reported by Nobuyoshi N…


Bug #6071: [Windows] exception in Dir.open doesn’t respect the encoding
of its argument

Author: Nobuyoshi N.
Status: Open
Priority: Normal
Assignee:
Category: M17N
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-02-24 trunk 34779) [i386-mingw32]

=begin
http://toro.2ch.net/test/read.cgi/tech/1324826777/711 から引用

Windows 1.9.3 と 2.0.0dev (2012-02-19) では
(({Dir.open}))のエラー表示はUTF-8の文字列をそのままWindowsのコンソールに出力して文字化けします
Dir.open(‘R:/存在しないdir’) #=> in `open’: No such file or directory -
R:/蟄伜惠縺励↑縺・ir (Errno::ENOENT)

引数を内部でUTF-8に変換してから処理しているみたいなので
どうするのがいいのかわかりません
p ‘日本語’.encode(‘UTF-8’) # => “\u65E5\u672C\u8A9E”
見たいなのだと読めないしなぁ
=end