# File lib/web.rb, line 257 def Web.escape(string) return nil unless string string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do '%' + $1.unpack('H2' * $1.size).join('%').upcase end.tr(' ', '+') end