Project

General

Profile

Feature #13943 ยป erb-unpack1.diff

znz (Kazuhiro NISHIYAMA), 09/27/2017 12:52 PM

View differences:

lib/erb.rb
#
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
    (1-1/1)