diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-02 06:06:00 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-02 06:06:00 +0000 |
commit | 012dc9d099db8b500e319894b4ed2cd0e7ad3f42 (patch) | |
tree | 3d563fdce670557cf3413f2d494f60de0e2ec620 /lib/cgi/util.rb | |
parent | 021c2102dc64ef86c142051bd0d20fc0ff2814fb (diff) | |
download | ruby-012dc9d099db8b500e319894b4ed2cd0e7ad3f42.tar.gz |
* lib/cgi/util.rb, lib/erb.rb: Use String#b [Feature #8394] by znz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi/util.rb')
-rw-r--r-- | lib/cgi/util.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index 98ff4be0ca..3fc462df27 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -15,7 +15,7 @@ module CGI::Util # string = CGI::unescape("%27Stop%21%27+said+Fred") # # => "'Stop!' said Fred" def unescape(string,encoding=@@accept_charset) - str=string.tr('+', ' ').force_encoding(Encoding::ASCII_8BIT).gsub(/((?:%[0-9a-fA-F]{2})+)/) do + str=string.tr('+', ' ').b.gsub(/((?:%[0-9a-fA-F]{2})+)/) do [$1.delete('%')].pack('H*') end.force_encoding(encoding) str.valid_encoding? ? str : str.force_encoding(string.encoding) |