Skip to content

Commit

Permalink
Update example showing that space is encoded with "+" (#61)
Browse files Browse the repository at this point in the history
* Update example with space encoded as "+" instead of "%20".

* Added a warning about encoding space as "+" instead of "%20".
  • Loading branch information
mgiuca authored and ewilligers committed Aug 6, 2018
1 parent 62df713 commit 9bcd5aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,18 @@ <h2>
window or tab and navigate to:
</p>
<pre>
https://example.org/includinator/share.html?name=My%20News&amp;link=http%3A%2F%2Fexample.com%2Fnews
https://example.org/includinator/share.html?name=My+News&amp;link=http%3A%2F%2Fexample.com%2Fnews
</pre>
<p class="warning">
U+0020 (SPACE) characters are encoded as "<code>+</code>", due to the
use of <a data-cite=
"URL#application/x-www-form-urlencoded"><code>application/x-www-form-urlencoded</code></a>
encoding, not "<code>%20</code>" as might be expected. Processors must
take care to decode U+002B (+) characters as U+0020 (SPACE), which some
URL decoding libraries, including ECMAScript's <a data-cite=
"ECMASCRIPT#sec-decodeuricomponent-encodeduricomponent"><code>decodeURIComponent</code></a>
function, may not do automatically.
</p>
<p>
The query parameters are populated with information from the
<a data-cite="WebShare#dom-sharedata"><code>ShareData</code></a> being
Expand Down

0 comments on commit 9bcd5aa

Please sign in to comment.