Skip to content

Instantly share code, notes, and snippets.

@mzaragoza
Created October 1, 2013 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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