Skip to content
instance method

CGI::Escape#escapeURIComponent

(::string) -> ::String
escapeURIComponent(string)

URL-encode a string following RFC 3986 Space characters (" ") are encoded with ("%20")

Example
url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred")
   # => "%27Stop%21%27%20said%20Fred"
See also #escape_uri_component #h #escapeHTML #unescape also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1