Skip to content

Instantly share code, notes, and snippets.

@mzaragoza
Created October 1, 2013 17:57
Show Gist options
  • Save mzaragoza/6782417 to your computer and use it in GitHub Desktop.
Save mzaragoza/6782417 to your computer and use it in GitHub Desktop.
require 'uri'
enc_uri = URI.escape("http://example.com/?a=\111\\115"")
p enc_uri
# => "http://example.com/?a=%09%0D"
p URI.unescape(enc_uri)
# => "http://example.com/?a=\t\r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment