diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-31 09:34:34 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-31 09:34:34 +0000 |
commit | 601f783827d8a7ef90537bab02d9ea6cc0b7f0f7 (patch) | |
tree | c8653df5c347b97a3e66778f9a73670adf8dc162 /lib/uri/common.rb | |
parent | 1c7f9073b018319fbea5ffe98d7264d4553aaec1 (diff) | |
download | ruby-601f783827d8a7ef90537bab02d9ea6cc0b7f0f7.tar.gz |
* lib/uri/common.rb (URI.decode_www_form_component): Use String#b.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r-- | lib/uri/common.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 8c657cdee7..771be971a5 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -899,9 +899,7 @@ module URI # See URI.encode_www_form_component, URI.decode_www_form def self.decode_www_form_component(str, enc=Encoding::UTF_8) raise ArgumentError, "invalid %-encoding (#{str})" unless /\A[^%]*(?:%\h\h[^%]*)*\z/ =~ str - str.dup.force_encoding("ASCII-8BIT") \ - .gsub(/\+|%\h\h/, TBLDECWWWCOMP_) \ - .force_encoding(enc) + str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc) end # Generate URL-encoded form data from given +enum+. |