This is very simple.
require “cgi”
def url_decode(address)
clean_address = CGI::unescape(address)
end
final_address = url_decode(”http%3A%2F%2Fwww%2Ethomasswift%2Ecom%2Fblog%2Furl%2Ddecoding%2Din%2Druby%2F”)
puts final_address
Save it and run it.
If for some reason this doesn’t suit your need, here are some other resources I was checking out.
Eric Meyer’s URL Encoder/Decoder - Code is included, but didn’t work on backslashes.
Kurt Dommermuth’s Flash URL Encoded/Decoder
URLEncode Chart