From: Benno Evers Date: 2009-10-24T05:53:43+09:00 Subject: [ruby-core:26260] [Bug #2259] Dir.foreach bug when used with command-line arguments Bug #2259: Dir.foreach bug when used with command-line arguments http://redmine.ruby-lang.org/issues/show/2259 Author: Benno Evers Status: Open, Priority: Normal ruby -v: ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux] This may be fixed in a newer version, but I couldn't check: benno@benno-laptop:~/test$ ruby1.9 -v ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux] benno@benno-laptop:~/test$ ls �������� test1.rb test2.rb benno@benno-laptop:~/test$ cat test1.rb Dir.foreach(".") {|s| p s } benno@benno-laptop:~/test$ cat test2.rb name = ARGV[0] Dir.foreach(name) {|s| p s } benno@benno-laptop:~/test$ ruby1.9 test1.rb "." ".." "test1.rb" "test2.rb" "\xC3\xA4\xC3\xB6\xC3\xBC\xC3\x9F" benno@benno-laptop:~/test$ ruby1.9 test2.rb . "." ".." "test1.rb" "test2.rb" test2.rb:2:in `foreach': conversion undefined for byte sequence (maybe invalid byte sequence) (RuntimeError) from test2.rb:2:in `
' ---------------------------------------- http://redmine.ruby-lang.org