I read the documentation of url_encode.
Is there a table that tells me exactly which character is encoded to what, using url_encode?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ERB’s
url_encodecan be tweaked:to:
In addition, Ruby’s CGI and URI modules have the ability to encode URLs, converting restricted characters to entities, so don’t overlook their offerings.
For instance, escaping characters for URL parameters:
Ruby CGI’s
escapealso uses a small regex to figure out which characters should be escaped in a URL. This is the method’s definition from the documentation:You also override that and change the regex, or expose it for your own use inside your redefinition of the method:
URI.encode_www_form_componentalso does a similar encoding, the only differences in characters are*and:And, similarly to overriding
CGI::escape, you can override the regex inURI.encode_www_form_component: