<?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>14676</bug_id>
          
          <creation_ts>2011-11-02 10:03:30 +0000</creation_ts>
          <short_desc>For UTF-16, the oder of the steps in &quot;change the encoding&quot; doesn&apos;t seem right.</short_desc>
          <delta_ts>2012-07-18 18:46:48 +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>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#changing-the-encoding-while-parsing</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>kennyluck</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>59473</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-11-02 10:03:30 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html
Multipage: http://www.whatwg.org/C#changing-the-encoding-while-parsing
Complete: http://www.whatwg.org/c#changing-the-encoding-while-parsing

Comment:
For UTF-16, the oder of the steps in &quot;change the encoding&quot; doesn&apos;t seem right.

Posted from: 114.43.127.97 by kennyluck@csail.mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59476</commentid>
    <comment_count>1</comment_count>
    <who name="KangHao Lu">kennyluck</who>
    <bug_when>2011-11-02 10:19:22 +0000</bug_when>
    <thetext>s/oder/order/

Consider a simple test case like, &lt;script&gt;alert(document.characterSet||document.charset)&lt;/script&gt;&lt;meta http-equiv=&quot;content-type&quot; content=&quot;charset=utf-16&quot;&gt; . By the pre-scanning algorithm, the first try should be utf-8. But then in step 1 of the &quot;change the encoding&quot; uft-16 isn&apos;t at that moment equivalent to utf-8, so a reload is possible depending on how you interpret the &quot;may&quot; in step 4.

Gecko doesn&apos;t reload in this case. IE first gives the default encoding (which contradicts the pre-scanning algorithm but that&apos;s another issue), and then &quot;unicode&quot; (but decodes the content in &quot;utf-8&quot;).

Anyway, is allowing reloading in my example intentional? If not, I propose we move step 3 before step 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59521</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-11-02 20:40:37 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6814.
Check-in comment: When a page interpreted as UTF-8 has a &lt;meta charset&gt; saying UTF-16, the spec used to say to reload even though the encoding didn&apos;t change.
http://html5.org/tools/web-apps-tracker?from=6813&amp;to=6814</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>