Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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"