# File lib/hub/speedy_stdlib.rb, line 12 def self.escape(s) s.to_s.gsub(ESCAPE_RE) {|match| '%' + match.unpack('H2' * match.bytesize).join('%').upcase }.tr(' ', '+') end
# File lib/hub/speedy_stdlib.rb, line 18 def self.unescape(s) s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/) { [$1.delete('%')].pack('H*') } end