From: naruse@... Date: 2015-12-16T07:56:47+00:00 Subject: [ruby-core:72179] [Ruby trunk - Bug #11819] [Rejected] URI::encode issue with the "+" character Issue #11819 has been updated by Yui NARUSE. 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. ---------------------------------------- Bug #11819: URI::encode issue with the "+" character https://bugs.ruby-lang.org/issues/11819#change-55593 * Author: Yacine PETITPREZ * Status: Rejected * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- `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.` -- https://bugs.ruby-lang.org/