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

ruby-changes:30221

From: knu <ko1@a...>
Date: Wed, 31 Jul 2013 18:34:50 +0900 (JST)
Subject: [ruby-changes:30221] knu:r42273 (trunk): * lib/uri/common.rb (URI.decode_www_form_component): Use String#b.

knu	2013-07-31 18:34:34 +0900 (Wed, 31 Jul 2013)

  New Revision: 42273

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

  Log:
    * lib/uri/common.rb (URI.decode_www_form_component): Use String#b.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42272)
+++ ChangeLog	(revision 42273)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 31 18:32:25 2013  Akinori MUSHA  <knu@i...>
+
+	* lib/uri/common.rb (URI.decode_www_form_component): Use String#b.
+
 Wed Jul 31 18:24:02 2013  Shugo Maeda  <shugo@r...>
 
 	* eval.c (rb_mod_refine, mod_using, top_using): don't show
Index: lib/uri/common.rb
===================================================================
--- lib/uri/common.rb	(revision 42272)
+++ lib/uri/common.rb	(revision 42273)
@@ -899,9 +899,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb#L899
   # 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+.

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

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