ruby-changes:47946
From: kazu <ko1@a...>
Date: Fri, 29 Sep 2017 20:00:05 +0900 (JST)
Subject: [ruby-changes:47946] kazu:r60061 (trunk): Use unpack1 instead of unpack and `[0]`
kazu 2017-09-29 20:00:00 +0900 (Fri, 29 Sep 2017) New Revision: 60061 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60061 Log: Use unpack1 instead of unpack and `[0]` [Feature #13943][ruby-core:83027] Modified files: trunk/lib/erb.rb Index: lib/erb.rb =================================================================== --- lib/erb.rb (revision 60060) +++ lib/erb.rb (revision 60061) @@ -994,7 +994,7 @@ class ERB https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L994 # def url_encode(s) s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m| - sprintf("%%%02X", m.unpack("C")[0]) + sprintf("%%%02X", m.unpack1("C")) } end alias u url_encode -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/