Skip to content

'+' now is percent-encoded in query string

Compare
Choose a tag to compare
@rdner rdner released this 20 Sep 14:50
· 104 commits to master since this release

The RFC 3986 basically tells us that we need to percent encode only delimiters of the URI part and + is not a delimiter (in fact, only &, # are at that point).

But it turns out, there are some platforms that use entity URL encoding algorithm for a URI and it works slightly different replacing + with a space character. Therefore, using + in query string actually breaks the logic. For instance, it happens in PHP.

So, we decided to encode + to %2B like other platforms do even if it's not a part of the standard and the standard also does not prohibit this.