* 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

@ -2356,4 +2356,15 @@ EOT
end
}
end if /mswin|mingw/ =~ RUBY_PLATFORM
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|
open(path) rescue $!.message.encoding
}
}
assert_equal(paths.map(&:encoding), encs, bug6071)
end
end