ISSUE-444: Bunch of small fixes

Bunch of small fixes

Raised by:
Richard Ishida
Opened on:

This issue tracks the bug listed above and was created as part of the WG CR process.



Hi, I found another small inaccuracy:


In algo "process":

1. If mode is not given, set it to replacement, if encoderDecoder is a decoder
instance, and fatal otherwise. << 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's handler on
token. << handler operate on two argument but you pass only /token/ (missing
some stream as first).


In algo "utf-8 decoder":

10. Emit a code point whose value is code point. << "emit" has special meaning
or it is just "return"? Ask because everywhere we have just return.


In algo "shared utf-16 encoder":

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


For "run" and "process" algo maybe add in prose that /error mode/ is optional,
sth like this:
"...and optional error mode mode, run these steps:" << just add "optional"


In IDL definition for TextEncoder.encode():

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


In green box for TextDecoder:

fatal.fatal << should be decoder.fatal
ignoreBOM.ignoreBOM << should be decoder.ignoreBOM

and in:

decoder . decode([input [, options]])
If the error mode is fatal set and encoding's decoder returns error, throws an
EncodingError. << "set" can be remove or write "...error mode is set to


In algo "serialize stream":

2.3 Otherwise, if token is not end-of-stream, append token to output. << first
"token" is variable.


In alg "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. << what exactly "," means here: & or |?


In gray API example

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.

Related Actions Items:
No related actions
Related emails:
  1. I18N-ISSUE-444 (BUG27281): Bunch of small fixes [encoding] (from on 2015-03-30)

Related notes:

Bug marked RESOLVED and FIXED.

Richard Ishida, 30 Mar 2015, 14:10:11

These issues are now tracked at

Richard Ishida, 16 Sep 2015, 11:53:03

Display change log ATOM feed

Addison Phillips <>, Chair, Richard Ishida <>, Fuqiao Xue <>, Atsushi Shimono <>, Staff Contacts
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <>.
$Id: index.php,v 1.326 2018/10/13 17:29:51 vivien Exp $