<?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>19945</bug_id>
          
          <creation_ts>2012-11-11 23:38:14 +0000</creation_ts>
          <short_desc>Unnecessary boundary checks in the HZ and ISO-2022-KR encoders</short_desc>
          <delta_ts>2013-01-07 16:36:58 +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>All</rep_platform>
          <op_sys>Windows 3.1</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>pub-w3</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>VYV03354</cc>
          
          <qa_contact>sideshowbarker+encodingspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78213</commentid>
    <comment_count>0</comment_count>
    <who name="">pub-w3</who>
    <bug_when>2012-11-11 23:38:14 +0000</bug_when>
    <thetext>The hz-gb-2312 encoder says:

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

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


The iso-2022-kr encoder says:

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

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

Furthermore:

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

I believe this cannot happen at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80998</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-01-07 16:26:15 +0000</bug_when>
    <thetext>I added those just in case. I guess I can comment them out for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80999</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-01-07 16:36:58 +0000</bug_when>
    <thetext>https://github.com/whatwg/encoding/commit/47d09ee49d2ad47a435e573e67347766e36c95d2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>