Method: Spider::HTTP.urldecode

Defined in:
lib/spiderfw/http/http.rb

.urldecode(s) ⇒ Object

Parameter

s<String>

String to URL unescape.

returns

String

The unescaped string.

– from Merb



155
156
157
158
159
# File 'lib/spiderfw/http/http.rb', line 155

def self.urldecode(s)
  s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){
    [$1.delete('%')].pack('H*')
  }
end