Given the string:
\"Hello there world\"
how can I create a URL-encoded string like this:
\"Hello%20there%20world\" <
\"Hello%20there%20world\"
While the current answer says to utilize URI.encode that has been deprecated and obsolete since Ruby 1.9.2. It is better to utilize CGI.escape or ERB::Util.url_encode.
URI.encode
CGI.escape
ERB::Util.url_encode