diff --git a/lib/erb.rb b/lib/erb.rb index 74974696d7..47bb5022cc 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -994,7 +994,7 @@ class ERB # 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