<?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>17151</bug_id>
          
          <creation_ts>2012-05-22 17:15:25 +0000</creation_ts>
          <short_desc>How should UTF-16BE &quot;\xD8\x00&quot; be decoded? This is an ill-formed UTF-16 code unit sequence, but it can be converted to a Unicode code point. Firefox/Opera currently convert it to U+FFFD, which seems like the preferred behaviour.</short_desc>
          <delta_ts>2012-07-18 18:40:46 +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>DUPLICATE</resolution>
          <dup_id>16768</dup_id>
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#the-input-byte-stream</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>annevk</cc>
    
    <cc>geoffers+w3cbugs</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68020</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-05-22 17:15:25 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#the-input-byte-stream
Complete: http://www.whatwg.org/c#the-input-byte-stream

Comment:
How should UTF-16BE &quot;\xD8\x00&quot; be decoded? This is an ill-formed UTF-16 code
unit sequence, but it can be converted to a Unicode code point. Firefox/Opera
currently convert it to U+FFFD, which seems like the preferred behaviour.

Posted from: 81.110.227.73 by geoffers@gmail.com
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1130.1 Safari/536.11</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68021</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Sneddon">geoffers+w3cbugs</who>
    <bug_when>2012-05-22 17:23:15 +0000</bug_when>
    <thetext>This pertains to the following:

&gt; Bytes or sequences of bytes in the original byte stream that could not be converted to Unicode code points must be converted to U+FFFD REPLACEMENT CHARACTERs. Specifically, if the encoding is UTF-8, the bytes must be decoded with the error handling defined in this specification.

&gt; Note: Bytes or sequences of bytes in the original byte stream that did not conform to the encoding specification (e.g. invalid UTF-8 byte sequences in a UTF-8 input byte stream) are errors that conformance checkers are expected to report.

&quot;\xD8\x00&quot; can obviously be decoded as if it were UTF-16BE to HTML5&apos;s definition of a &quot;Unicode code point&quot; (which include lone surrogates), but according to the Unicode specification it is an invalid UTF-16 code unit sequence.

It would seem preferable that lone surrogates get converted to U+FFFD as they currently are in Opera/Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68029</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-05-23 06:40:30 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/encoding/raw-file/tip/Overview.html#utf-16-decoder already handles lone surrogates, AFAICT. HTML just needs to reference that spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68030</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-05-23 07:52:49 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 16768 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>