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 19945 - Unnecessary boundary checks in the HZ and ISO-2022-KR encoders
Summary: Unnecessary boundary checks in the HZ and ISO-2022-KR encoders
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Encoding (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+encodingspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-11 23:38 UTC by pub-w3
Modified: 2013-01-07 16:36 UTC (History)
2 users (show)

See Also:


Attachments

Description pub-w3 2012-11-11 23:38:14 UTC
The hz-gb-2312 encoder says:

> If either lead or trail is not in the range 0x21 to 0x7E,
> emit an encoder error.

This can only happen if lead < 0x21 or trail < 0x21 (possibly negative); there should be no need to check the upper boundaries.


The iso-2022-kr encoder says:

> If lead is not in the range 0x21 to 0x46 or trail is not in the range
> 0x21 to 0x7E, emit an encoder error.

Again, this can only happen if lead < 0x21 or trail < 0x21 (possibly negative).

Furthermore:

> If lead is not in the range 0x47 to 0x7E or trail is not in the range
> 0x21 to 0x7E, emit an encoder error.

I believe this cannot happen at all.
Comment 1 Anne 2013-01-07 16:26:15 UTC
I added those just in case. I guess I can comment them out for now.