diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-15 00:42:25 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-15 00:42:25 +0000 |
commit | 7588f09a87a7d89404e2d6036c71e124c8c403ae (patch) | |
tree | 20dd8f501824f5b086265445fc5a87bc14349911 /lib/uri | |
parent | 732d041dc8d0892cc0f8f3ecbd3a59a8908d4763 (diff) |
* lib/uri/common.rb (URI.encode_www_component):
call str.to_s at first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri')
-rw-r--r-- | lib/uri/common.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 19ca44d7bc..b4de6ad40c 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -743,9 +743,11 @@ module URI end TBLENCWWWCOMP_.freeze end - str = str.dup.force_encoding(Encoding::ASCII_8BIT) + str = str.to_s.dup + enc = str.encoding + str.force_encoding(Encoding::ASCII_8BIT) str.gsub!(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_) - str + str.force_encoding(enc) end # Decode given +str+ of URL-encoded form data. |