[前][次][番号順一覧][スレッド一覧]

ruby-changes:15058

From: naruse <ko1@a...>
Date: Mon, 15 Mar 2010 09:42:41 +0900 (JST)
Subject: [ruby-changes:15058] Ruby:r26934 (trunk): * lib/uri/common.rb (URI.encode_www_component):

naruse	2010-03-15 09:42:25 +0900 (Mon, 15 Mar 2010)

  New Revision: 26934

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26934

  Log:
    * lib/uri/common.rb (URI.encode_www_component):
      call str.to_s at first.

  Modified files:
    trunk/ChangeLog
    trunk/lib/uri/common.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26933)
+++ ChangeLog	(revision 26934)
@@ -1,3 +1,8 @@
+Mon Mar 15 09:34:17 2010  NARUSE, Yui  <naruse@r...>
+
+	* lib/uri/common.rb (URI.encode_www_component):
+	  call str.to_s at first.
+
 Mon Mar 15 09:36:22 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* symbian/README.SYMBIAN: fixed broken patch and converted to
Index: lib/uri/common.rb
===================================================================
--- lib/uri/common.rb	(revision 26933)
+++ lib/uri/common.rb	(revision 26934)
@@ -743,9 +743,11 @@
       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.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]