summaryrefslogtreecommitdiff
path: root/test/webrick/test_filehandler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r--test/webrick/test_filehandler.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index 9674c176cf..998e03f690 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -291,6 +291,13 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
end
def test_multibyte_char_in_path
+ if Encoding.default_external == Encoding.find('US-ASCII')
+ reset_encoding = true
+ verb = $VERBOSE
+ $VERBOSE = false
+ Encoding.default_external = Encoding.find('UTF-8')
+ end
+
c = "\u00a7"
begin
c = c.encode('filesystem')
@@ -320,6 +327,11 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
}
end
end
+ ensure
+ if reset_encoding
+ Encoding.default_external = Encoding.find('US-ASCII')
+ $VERBOSE = verb
+ end
end
def test_script_disclosure