diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-23 07:46:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-23 07:46:12 +0000 |
commit | c68d29960b4027da6fed55576a523f42f6182f28 (patch) | |
tree | b045e6c69426ce719b704ab6a977afcc8cb4f8fe /test | |
parent | 2933909caf01896d45eefa23e9c839fd1e03d652 (diff) | |
download | ruby-c68d29960b4027da6fed55576a523f42f6182f28.tar.gz |
load.c: keep encoding of feature name
* file.c (rb_find_file_ext_safe, rb_find_file_safe): default to
US-ASCII for encdb and transdb.
* load.c (search_required): keep encoding of feature name. set
loading path to filesystem encoding. [Bug #6377][ruby-core:44750]
* ruby.c (add_modules, require_libraries): assume default external
encoding as well as ARGV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_require.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 9286994e22..1d135f0e6b 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -418,4 +418,21 @@ class TestRequire < Test::Unit::TestCase $".delete(path) tmp.close(true) if tmp end + + def test_loaded_features_encoding + bug6377 = '[ruby-core:44750]' + loadpath = $:.dup + features = $".dup + $".clear + $:.clear + Dir.mktmpdir {|tmp| + $: << tmp + open(File.join(tmp, "foo.rb"), "w") {} + require "foo" + assert_equal(tmp.encoding, $"[0].encoding, bug6377) + } + ensure + $:.replace(loadpath) + $".replace(features) + end end |