diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-04 09:21:12 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-04 09:21:12 +0000 |
commit | 7a28371f584336671693148a7337d30b47215b86 (patch) | |
tree | 1937cf79924c23dd6535a9b51feed6df9a7e70a6 /lib/uri | |
parent | 73716b9d2f90a567682be17a72e9a0d655b81efc (diff) |
merges r22706 from trunk into ruby_1_9_1.
--
* lib/uri/common.rb (URI::Parser#escape): escaped string is ascii
only.
* lib/uri/common.rb (URI::Parser#unescape): converts bytewise.
[ruby-dev:38005], [ruby-dev:38110]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@22760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri')
-rw-r--r-- | lib/uri/common.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 9a6a06894a..827ed7883d 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -223,11 +223,11 @@ module URI tmp << sprintf('%%%02X', uc) end tmp - end + end.force_encoding(Encoding::US_ASCII) end def unescape(str, escaped = @regexp[:ESCAPED]) - str.gsub(escaped) { [$&[1, 2].hex].pack('U') } + str.gsub(escaped) { [$&[1, 2].hex].pack('C') }.force_encoding(str.encoding) end @@to_s = Kernel.instance_method(:to_s) |