Skip to content

Commit

Permalink
Add the component percent-encode set
Browse files Browse the repository at this point in the history
Complements whatwg/html#5524.

Closes #369.
  • Loading branch information
annevk committed May 12, 2020
1 parent 8e1c9e3 commit 59f9edd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ Abstract: The URL Standard defines URLs, domains, IP addresses, the <code>applic
Translation: ja https://triple-underscore.github.io/URL-ja.html
</pre>

<!-- TODO: remove after Bikeshed database updates itself to no longer have url version -->
<pre class=link-defaults>
spec:html; type:dfn; text:same site
<pre class=anchors>
url: https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent; text: encodeURIComponent(); type: method; spec: ECMA-262
</pre>


Expand Down Expand Up @@ -189,6 +188,16 @@ U+0020 SPACE, U+0022 ("), U+003C (&lt;), U+003E (&gt;), and U+0060 (`).
<a>path percent-encode set</a> and U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@),
U+005B ([) to U+005E (^), inclusive, and U+007C (|).

<p>The <dfn export>component percent-encode set</dfn> is the <a>userinfo percent-encode set</a> and
U+0024 ($) to U+0026 (&amp;), inclusive, U+002B (+), and U+002C (,).

<p class=note>This is used by the <cite>HTML standard</cite> for
{{NavigatorContentUtils/registerProtocolHandler()}} and could also be used by other standards to
percent-encode data that can then be embedded in a <a for=/>URL</a>'s <a for=url>path</a>,
<a for=url>query</a>, or <a for=url>fragment</a>. Using it with
<a for=string>UTF-8 percent-encode</a> gives identical results to JavaScript's
<a><code>encodeURIComponent()</code></a> [sic]. [[HTML]] [[ECMA-262]]

<p class=note>The <a><code>application/x-www-form-urlencoded</code></a> format's
<a lt="urlencoded byte serializer">byte serializer</a> and the <a>URL parser</a>'s
<a>query state</a> use <a for=byte>percent-encode</a> directly without any of these sets.
Expand Down

0 comments on commit 59f9edd

Please sign in to comment.