Skip to content

Commit b579018

Browse files
committed
Give clearer advice on hooks for standards
Fixes #125.
1 parent 1c6f66a commit b579018

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

Diff for: encoding.bs

+19-8
Original file line numberDiff line numberDiff line change
@@ -842,14 +842,25 @@ different format here, to be able to represent ranges.)
842842

843843

844844

845-
<h2 id=specification-hooks>Specification hooks</h2>
846-
847-
<p class=note>The algorithms <a>decode</a>, <a>UTF-8 decode</a>,
848-
<a>UTF-8 decode without BOM</a>, <a>UTF-8 decode without BOM or fail</a>,
849-
<a for=/>encode</a>, and <a>UTF-8 encode</a> are intended for usage by other specifications.
850-
<a>UTF-8 decode</a> is to be used by new formats. The
851-
<a>get an encoding</a> algorithm can be used first to turn a
852-
<a>label</a> into an <a for=/>encoding</a>.
845+
<h2 id=specification-hooks>Hooks for standards</h2>
846+
847+
<div class=note>
848+
<p>The algorithms defined below (<a>decode</a>, <a>UTF-8 decode</a>,
849+
<a>UTF-8 decode without BOM</a>, <a>UTF-8 decode without BOM or fail</a>, <a for=/>encode</a>, and
850+
<a>UTF-8 encode</a>) are intended for usage by other standards.
851+
852+
<p>For decoding, <a>UTF-8 decode</a> is to be used by new formats. For identifiers or byte
853+
sequences within a format or protocol, use <a>UTF-8 decode without BOM</a> or
854+
<a>UTF-8 decode without BOM or fail</a>.
855+
856+
<p>For encoding, <a>UTF-8 encode</a> is to be used.
857+
858+
<p>Standards are strongly discouraged from using <a>decode</a> and <a for=/>encode</a>, except as
859+
needed for compatibility.
860+
861+
<p>The <a>get an encoding</a> algorithm is to be used to turn a <a>label</a> into an
862+
<a for=/>encoding</a>.
863+
</div>
853864

854865
<p>To <dfn export>decode</dfn> a byte stream <var>stream</var> using
855866
fallback encoding <var>encoding</var>, run these steps:

0 commit comments

Comments
 (0)