diff options
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r-- | test/webrick/test_filehandler.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index edf0d8b12c..758ec7f589 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -294,7 +294,12 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase config = { :DocumentRoot => dir } TestWEBrick.start_httpserver(config) do |server, addr, port, log| http = Net::HTTP.new(addr, port) - req = Net::HTTP::Get.new("/%E3%81%82.txt") + begin + path = "/\u3042.txt".encode('filesystem') + rescue EncodingError + path = "/\u3042.txt".force_encoding(Encoding::ASCII_8BIT) + end + req = Net::HTTP::Get.new(WEBrick::HTTPUtils::escape(path)) http.request(req){|res| assert_equal("200", res.code, log.call + "\nFilesystem encoding is #{Encoding.find('filesystem')}") } end end |