summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-03 13:27:01 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-03 13:27:01 +0000
commita1525108b87dac3032754f4152d37258f3ea4c0c (patch)
treeef38470d2d9754a4271995e1a0d3792429620e48 /test
parent65fcd2e73881b48c587433a5fbebc6c2794c1ebd (diff)
merge revision(s) 42271: [Backport #8713]
* 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/branches/ruby_2_0_0@42355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 9dc87dcbc5..97c6035340 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -69,6 +69,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