<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27281</bug_id>
          
          <creation_ts>2014-11-08 14:38:27 +0000</creation_ts>
          <short_desc>Bunch of small fixes</short_desc>
          <delta_ts>2014-11-08 21:57:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>Encoding</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arkadiusz Michalski (Spirit)">crimsteam</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>www-international</cc>
          
          <qa_contact>sideshowbarker+encodingspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>114717</commentid>
    <comment_count>0</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-11-08 14:38:27 +0000</bug_when>
    <thetext>Hi, I found another small inaccuracy:

===

In algo &quot;process&quot;:
https://encoding.spec.whatwg.org/#concept-encoding-process

1. If mode is not given, set it to replacement, if encoderDecoder is a decoder instance, and fatal otherwise. &lt;&lt; should not be /encoderDecoderInstance/ instead of /encoderDecoder/? We pass to this algo /encoderDecoderInstance/.

and next step in the same algo:

2. Let result be the result of running encoderDecoderInstance&apos;s handler on token. &lt;&lt; handler operate on two argument but you pass only /token/ (missing some stream as first).

===

In algo &quot;utf-8 decoder&quot;:
https://encoding.spec.whatwg.org/#utf-8-decoder

10. Emit a code point whose value is code point. &lt;&lt; &quot;emit&quot; has special meaning or it is just &quot;return&quot;? Ask because everywhere we have just return.

=== 

In algo &quot;shared utf-16 encoder&quot;:
https://encoding.spec.whatwg.org/#shared-utf-16-encoder

2. If code point is in the range 0x00 to 0xFFFF, return the... &lt;&lt; this range can be express as U+0000 to U+FFFF (like everywhere).

=== 

For &quot;run&quot; and &quot;process&quot; algo maybe add in prose that /error mode/ is optional, sth like this:
&quot;...and optional error mode mode, run these steps:&quot; &lt;&lt; just add &quot;optional&quot; word.

===

In IDL definition for TextEncoder.encode():

Uint8Array encode(optional USVString input = &quot;&quot;); &lt;&lt; maybe add [NewObject], this always return new object.

=== 

In green box for TextDecoder:

fatal.fatal &lt;&lt; should be decoder.fatal
ignoreBOM.ignoreBOM &lt;&lt; should be decoder.ignoreBOM

and in:

decoder . decode([input [, options]])
If the error mode is fatal set and encoding&apos;s decoder returns error, throws an EncodingError. &lt;&lt; &quot;set&quot; can be remove or write &quot;...error mode is set to fatal...&quot; 

===

In algo &quot;serialize stream&quot;:
https://encoding.spec.whatwg.org/#concept-td-serialize

2.3 Otherwise, if token is not end-of-stream, append token to output. &lt;&lt; first &quot;token&quot; is variable.

=== 

In alg &quot;shift_jis decoder&quot;:
https://encoding.spec.whatwg.org/#shift_jis-decoder

1. If byte is end-of-stream, shift_jis lead is not 0x00, set shift_jis lead to 0x00 and return error. &lt;&lt; what exactly &quot;,&quot; means here: &amp; or |?

===

In gray API example 
https://encoding.spec.whatwg.org/#api

function encodeArrayOfStrings has declared encoder = new TextEncoder(encoding); but its never used. Probably it can be used here (insted of constructor):

encoded[i] = new TextEncoder(encoding).encode(strings[i]); 

====

I guess all, thanks for attention.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114724</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-11-08 21:57:33 +0000</bug_when>
    <thetext>You have the best nits. Thank you!

https://github.com/whatwg/encoding/commit/81ab5c1c3f6a5fcff155934a3912b08636a09204</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>