[encoding] Big5 decoder fails to prepend ASCII byte when pointer is non-null but code point is null (#5)

Consider decoding 0x81 0x40 as Big5.

* First, 0x81 becomes _big5lead_.
* Then, when _byte_ is 0x40, _pointer_ becomes non-null at step #2.
* At step #4, there's a lookup from the index by _pointer_, but the index entry is missing, so _code point_ becomes null.
* Now _pointer_ is still non-null!
* Since _pointer_ is non-null, step #5 does nothing and an ASCII byte (0x40) gets eaten.
* Since _code point_ is null, U+FFFD gets emitted in step #6.

Please adjust step #5 to perform the null test on _code point_ instead of performing it on _pointer_.


---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/5

Received on Wednesday, 17 June 2015 11:10:19 UTC