summaryrefslogtreecommitdiff
path: root/test/uri/test_common.rb
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 09:00:18 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 09:00:18 +0000
commitb30a1723853bc1a189930a5c7ebdfc5ec7e4817b (patch)
treeecdd62d9e204447288ecfa91ce14a8ea2f43c383 /test/uri/test_common.rb
parent37c05ec3ed1e7566acf54ccbbf90dfb1e790539c (diff)
* lib/uri/common.rb (URI.decode_www_form_component):
Don't raise error when str includes multibyte characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri/test_common.rb')
-rw-r--r--test/uri/test_common.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index 65a92f3868..1675257d5c 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -91,6 +91,9 @@ class TestCommon < Test::Unit::TestCase
"AZ%5B%5C%5D%5E_%60az%7B%7C%7D%7E"))
assert_equal("\xA1\xA2".force_encoding(Encoding::EUC_JP),
URI.decode_www_form_component("%A1%A2", "EUC-JP"))
+ assert_equal("\xE3\x81\x82\xE3\x81\x82".force_encoding("UTF-8"),
+ URI.decode_www_form_component("\xE3\x81\x82%E3%81%82".force_encoding("UTF-8")))
+
assert_raise(ArgumentError){URI.decode_www_form_component("%")}
end