Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

CGI::Util#unescape

unescape(string, encoding = @@accept_charset)

URL-decode an application/x-www-form-urlencoded string with encoding(optional).

Example
string = CGI.unescape("%27Stop%21%27+said+Fred")
   # => "'Stop!' said Fred"