Skip to content

Commit 72b39c1

Browse files
committed
Clean up byte string intro, some edits
1 parent 4fb6dbb commit 72b39c1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎index.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ <h2>Introduction</h2>
144144

145145

146146

147-
148-
149147
<section class="appendix" id="ghChecklist">
150148
<h3>Create a github checklist</h3>
151149

@@ -1680,14 +1678,19 @@ <h4>Working with Byte-oriented Formats</h4>
16801678
<p><a href="https://www.w3.org/TR/string-meta/#protocol-strings">Strings that are part of a legacy protocol or format</a>, in <cite>Strings on the Web: Language and Direction Metadata</cite> [[STRING-META]]</p>
16811679
</div>
16821680

1683-
<p>Sometimes specifications need to deal with byte-oriented contexts. For example, the specification might be defining a binary format or working with a byte-oriented protocol.</p>
1681+
<p>Sometimes specifications need to deal with the storage, interpretation, and manipulation of the byte values of various characters. Some (non-exhaustive) examples of this include:
1682+
<ul>
1683+
<li>Defining a binary format</li>
1684+
<li>Parsing HTTP headers</li>
1685+
<li>Describing the wire format of a protocol</li>
1686+
</ul></p>
16841687

16851688

16861689
<div class="req" id="char-string-dom-usv-bytes">
1687-
<p class="advisement">Specify fields in protocols that are 'string-like' as {{DOMString}} or, rarely, {{USVString}}, unless there is some reason to interact with specific bytes values or for which the UTF-8 [=character encoding=] cannot be assumed.</p>
1690+
<p class="advisement">Specify 'string-like' fields as {{DOMString}} or, rarely, {{USVString}}, unless there is some reason to interact with specific bytes values or for which the UTF-8 [=character encoding=] cannot be assumed.</p>
16881691
</div>
16891692

1690-
<p>If the field in question is meant to be treated as a string, working with (Unicode) characters will be more reliable than trying to work with byte values. The data encoded into these fields will be deserialized from the wire format into your local in-memory string representation, such as the [[DOM]], JavaScript strings, or your platform's native Unicode string type and later it will need to be serialized into the wire format using some [=character encoding form=] (usually UTF-8).</p>
1693+
<p>If the field in question is meant to be treated as a string, working with (Unicode) characters will be more reliable than trying to work with the byte values directly. The data encoded into these fields will be deserialized from the wire format into your local in-memory string representation, such as the [[DOM]], JavaScript strings, or your platform's native Unicode string type. Later it will need to be serialized into the wire format using some [=character encoding form=] (usually&mdash;and <em>preferably</em>&mdash; UTF-8).</p>
16911694

16921695
<div class="req" id="char_string_byte">
16931696
<p class="advisement">Specify {{ByteString}} only when working with protocols (such as HTTP) or formats that don't distinguish between bytes and strings. If you need to represent a sequence of bytes, use {{Uint8Array}}.</p>

0 commit comments

Comments
 (0)