1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dir.c (dir_initialize): keep path in original encoding.

* error.c (syserr_initialize): prefer the encoding of message over
  locale.  [ruby-dev:45279][Bug #6071]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-02-24 22:53:42 +00:00
parent cc07e34bfc
commit 85738261a5
5 changed files with 38 additions and 9 deletions

View file

@ -213,5 +213,16 @@ class TestDir_M17N < Test::Unit::TestCase
EOS
}
end
def test_error_nonascii
bug6071 = '[ruby-dev:45279]'
paths = ["\u{3042}".encode("sjis"), "\u{ff}".encode("iso-8859-1")]
encs = with_tmpdir {
paths.map {|path|
Dir.open(path) rescue $!.message.encoding
}
}
assert_equal(paths.map(&:encoding), encs, bug6071)
end
end