Actions
Bug #11819
closedURI::encode issue with the "+" character
Description
URI.encode("a+b")
returns "a+b". Mostly all web servers transform the "+" in URI parameters to space, and can create issue with base64 encoded parameters for example.
Currently we must write this:
args = URI.encode(args).gsub("+", "%2B")
Also, the rfc2396 says (G. 2):
The plus "+", dollar "$", and comma "," characters have been added to those in the "reserved" set, since they are treated as reserved within the query component.
Updated by naruse (Yui NARUSE) almost 10 years ago
- Status changed from Open to Rejected
As the manual says URI.escape escapes invalid characters in URI; you know "+" is valid.
Use URI. encode_www_form or URI.encode_www_form_component.
Actions
Like0
Like0