This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27281 - Bunch of small fixes
Summary: Bunch of small fixes
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Encoding (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+encodingspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-08 14:38 UTC by Arkadiusz Michalski (Spirit)
Modified: 2014-11-08 21:57 UTC (History)
2 users (show)

See Also:


Attachments

Description Arkadiusz Michalski (Spirit) 2014-11-08 14:38:27 UTC
Hi, I found another small inaccuracy:

===

In algo "process":
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. << 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":
https://encoding.spec.whatwg.org/#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":
https://encoding.spec.whatwg.org/#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" word.

===

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 fatal..." 

===

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

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

=== 

In alg "shift_jis decoder":
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. << what exactly "," means here: & 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.
Comment 1 Anne 2014-11-08 21:57:33 UTC
You have the best nits. Thank you!

https://github.com/whatwg/encoding/commit/81ab5c1c3f6a5fcff155934a3912b08636a09204