aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_dir_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 00:28:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 00:28:01 +0000
commita0b6e366093a25f05d7463b405d663f74077d517 (patch)
tree11b07f912fdfddc1b965cc018cb2ca7a5e699702 /test/ruby/test_dir_m17n.rb
parent8dbf0f2ac78bf62250a94ce3e72f01d6b531c0c2 (diff)
downloadruby-a0b6e366093a25f05d7463b405d663f74077d517.tar.gz
test_dir_m17n.rb: read in filesystem encoding
* test/ruby/test_dir_m17n.rb (test_entries_compose): read in filesystem encoding instead of default external encoding on Windows too. these two encodings may differ on some environments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir_m17n.rb')
-rw-r--r--test/ruby/test_dir_m17n.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 5d009aceb1..03b1597e2c 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -404,12 +404,12 @@ class TestDir_M17N < Test::Unit::TestCase
with_tmpdir {|d|
orig = %W"d\u{e9}tente x\u{304c 304e 3050 3052 3054}"
orig.each {|n| open(n, "w") {}}
+ enc = Encoding.find("filesystem")
+ enc = Encoding::ASCII_8BIT if enc == Encoding::US_ASCII
if /mswin|mingw/ =~ RUBY_PLATFORM
- opts = {:encoding => Encoding.default_external}
+ opts = {:encoding => enc}
orig.map! {|o| o.encode("filesystem") rescue o.tr("^a-z", "?")}
else
- enc = Encoding.find("filesystem")
- enc = Encoding::ASCII_8BIT if enc == Encoding::US_ASCII
orig.each {|o| o.force_encoding(enc) }
end
ents = Dir.entries(".", opts).reject {|n| /\A\./ =~ n}