From 6db869c1019948a878b2735ca205888af2e07ecb Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 8 Mar 2018 09:38:01 +0000 Subject: fix error if the input is mixed Unicode and percent-escapes Reported by kivikakk (Ashe Connor) with tests and doc fix Patch based on mame and fix by naruse [Bug #14586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/uri/test_parser.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/uri') diff --git a/test/uri/test_parser.rb b/test/uri/test_parser.rb index 757ac86c74..b9cf4b7e1a 100644 --- a/test/uri/test_parser.rb +++ b/test/uri/test_parser.rb @@ -45,4 +45,11 @@ class URI::TestParser < Test::Unit::TestCase URI.parse(1) end end + + def test_unescape + p1 = URI::Parser.new + assert_equal("\xe3\x83\x90", p1.unescape("\xe3\x83\x90")) + assert_equal("\xe3\x83\x90", p1.unescape('%e3%83%90')) + assert_equal("\xe3\x83\x90\xe3\x83\x90", p1.unescape("\xe3\x83\x90%e3%83%90")) + end end -- cgit v1.2.1