summaryrefslogtreecommitdiff
path: root/test/ruby/test_io_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 22:53:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 22:53:42 +0000
commit85738261a582ceef498b86b784171fba59bf60cc (patch)
treeaa97e06f7c4474313689463864dcb672a3d93552 /test/ruby/test_io_m17n.rb
parentcc07e34bfcc9675924fd0546b46eb53c3d972ab8 (diff)
* 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
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 737fae479b2..02e60fb62fb 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -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