Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CGI::Escape#escape_uri_component
(::string) -> ::String
escape_uri_component(p1)
ext/cgi/escape/escape.c
View on GitHub ↗
static VALUE
cgiesc_escape_uri_component(VALUE self, VALUE str)
{
StringValue(str);
if (rb_enc_str_asciicompat_p(str)) {
return optimized_escape(str, 0);
}
else {
return rb_call_super(1, &str);
}
}
Alias of #escapeURIComponent
Returns URL-escaped string following RFC 3986.