Skip to content

End of Life Ruby 3.0 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 a string with encoding(optional).

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