public Method

Escape.unescape(str)

Contents:

Synopsis

URI.unescape(str)

Args

str:Unescapes the string.

Usage

require 'uri'

enc_uri = URI.escape("http://example.com/?a=\11\15")
p enc_uri
# => "http://example.com/?a=%09%0D"

p URI.unescape(enc_uri)
# => "http://example.com/?a=\t\r"

Source Code

# File uri/common.rb, line 319
def unescape(str)
  str.gsub(ESCAPED) do
    $&[1,2].hex.chr
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.