summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 04:04:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 04:04:23 +0000
commit8948280c67072f652eebc31bc3a2f3fb86bcca5f (patch)
tree8e433b03c6bc0f19f1a166b53d8aea0430e24c97 /test
parent2c181b6d1a0514204e049e5f37529b8b8ccfe434 (diff)
load.c: search in OS path encoding
* load.c (rb_load_internal): use rb_load_file_str() to keep path encoding. * load.c (rb_require_safe): search in OS path encoding for Windows. * ruby.c (rb_load_file_str): load file with keeping path encoding. * win32/file.c (rb_file_load_ok): use WCHAR type API assuming incoming path is encoded in UTF-8. [ruby-core:56136] [Bug #8676] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 8d40f3dd804..41cbff5c028 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -61,10 +61,17 @@ class TestRequire < Test::Unit::TestCase
def test_require_nonascii_path
bug8165 = '[ruby-core:53733] [Bug #8165]'
- encoding = /mswin|mingw/ =~ RUBY_PLATFORM ? 'filesystem' : 'UTF-8'
+ encoding = 'filesystem'
assert_require_nonascii_path(encoding, bug8165)
end
+ def test_require_nonascii_path_utf8
+ bug8676 = '[ruby-core:56136] [Bug #8676]'
+ encoding = Encoding::UTF_8
+ return if Encoding.find('filesystem') == encoding
+ assert_require_nonascii_path(encoding, bug8676)
+ end
+
def assert_require_nonascii_path(encoding, bug)
Dir.mktmpdir {|tmp|
dir = "\u3042" * 5