Skip to content

Commit 9bcd5aa

Browse files
mgiucaewilligers
authored andcommitted
Update example showing that space is encoded with "+" (#61)
* Update example with space encoded as "+" instead of "%20". * Added a warning about encoding space as "+" instead of "%20".
1 parent 62df713 commit 9bcd5aa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,18 @@ <h2>
150150
window or tab and navigate to:
151151
</p>
152152
<pre>
153-
https://example.org/includinator/share.html?name=My%20News&amp;link=http%3A%2F%2Fexample.com%2Fnews
153+
https://example.org/includinator/share.html?name=My+News&amp;link=http%3A%2F%2Fexample.com%2Fnews
154154
</pre>
155+
<p class="warning">
156+
U+0020 (SPACE) characters are encoded as "<code>+</code>", due to the
157+
use of <a data-cite=
158+
"URL#application/x-www-form-urlencoded"><code>application/x-www-form-urlencoded</code></a>
159+
encoding, not "<code>%20</code>" as might be expected. Processors must
160+
take care to decode U+002B (+) characters as U+0020 (SPACE), which some
161+
URL decoding libraries, including ECMAScript's <a data-cite=
162+
"ECMASCRIPT#sec-decodeuricomponent-encodeduricomponent"><code>decodeURIComponent</code></a>
163+
function, may not do automatically.
164+
</p>
155165
<p>
156166
The query parameters are populated with information from the
157167
<a data-cite="WebShare#dom-sharedata"><code>ShareData</code></a> being

0 commit comments

Comments
 (0)