End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
CGI::Escape#unescape
CGI.unescape(string, encoding=@@accept_charset) → string
ext/cgi/escape/escape.c
View on GitHub ↗
static VALUE
cgiesc_unescape(int argc, VALUE *argv, VALUE self)
{
VALUE str = (rb_check_arity(argc, 1, 2), argv[0]);
StringValue(str);
if (rb_enc_str_asciicompat_p(str)) {
VALUE enc = accept_charset(argc-1, argv+1, self);
return optimized_unescape(str, enc, 1);
}
else {
return rb_call_super(argc, argv);
}
}
Returns URL-unescaped string (application/x-www-form-urlencoded).
See also
#escapeURIComponent
#unescapeHTML
#escapeHTML
#unescapeURIComponent
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0