Skip to content

Commit

Permalink
Editorial: clarify the UTF-8ness of percent-encoded bytes
Browse files Browse the repository at this point in the history
Closes #501.
  • Loading branch information
annevk authored Dec 20, 2022
1 parent a05ee27 commit 6ad2f04
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ error.
<h3 id=percent-encoded-bytes>Percent-encoded bytes</h3>

<p>A <dfn>percent-encoded byte</dfn> is U+0025 (%), followed by two <a>ASCII hex digits</a>.
Sequences of <a lt="percent-encoded byte">percent-encoded bytes</a>,
<a for=string>percent-decoded</a>, should not cause <a>UTF-8 decode without BOM or fail</a> to
return failure.

<p class=note>It is generally a good idea for sequences of <a>percent-encoded bytes</a> to be such
that, when <a for=string>percent-decoded</a> and then passed to
<a>UTF-8 decode without BOM or fail</a>, they do not end up as failure. How important this is
depends on where the <a>percent-encoded bytes</a> are used. E.g., for the <a>host parser</a> not
following this advice is fatal, whereas for <a href="#url-rendering-i18n">URL rendering</a> the
<a>percent-encoded bytes</a> would not be rendered <a for=string>percent-decoded</a>.

<div algorithm>
<p>To <dfn for=byte id=percent-encode>percent-encode</dfn> a <a for=/>byte</a> <var>byte</var>,
Expand Down

0 comments on commit 6ad2f04

Please sign in to comment.