<?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>12242</bug_id>
          
          <creation_ts>2011-03-05 02:39:03 +0000</creation_ts>
          <short_desc>Make UTF-16 an invalid encoding in Polyglot Markup  (i18n-issue-17)</short_desc>
          <delta_ts>2011-08-04 05:07:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html#character-encoding</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leif Halvard Silli">xn--mlform-iua</reporter>
          <assigned_to name="Eliot Graff">eliotgra</assigned_to>
          <cc>addison</cc>
    
    <cc>cowan</cc>
    
    <cc>eliotgra</cc>
    
    <cc>ishida</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>shadow2531</cc>
    
    <cc>www-international</cc>
    
    <cc>xn--mlform-iua</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46388</commentid>
    <comment_count>0</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-03-05 02:39:03 +0000</bug_when>
    <thetext>* According to HTML5,  HTML-parsers must as minimum support UTF-8
    and Windows-1252.
   http://dev.w3.org/html5/spec/parsing.html#character-encodings-0
* While according to XML, XML-parsers must as mininum support UTF-8
   and UTF-16.
* Polyglot Markup, though, &quot;prefers&quot; UTF-8 (based on HTML5&apos;s UTF-8
   preference, one should think), but else follows the XML approach and 
   permits both UTF-8 or UTF-16.

AS A RESULT, it becomes possible to author &quot;polyglot markup&quot; that works fine in XML-parsers, but which isn&apos;t required to work in all and any HTML-parser.

We should not declare mark-up that isn&apos;t required to work in a HTML-parser as &quot;polyglot markup&quot;. Hence we should conclude that UTF-16 should not be a recommended encoding for Polyglot Markup.

   Discussion:

* It was suggested early on, e.g. by e.g. Sam Ruby, that UTF-8 should be the only recommended encoding for polyglot markup. And this can be a very useful suggestion. For instance, it would become a very useful way to &quot;force&quot; many HTML editing programs to default to UTF-8, one should think. It also meets HTML5 which says that new documents SHOULD default to UTF-8.

* However, the problem is to justify *exclusion* of UTF-16 by inference from the specs. Because, the use of UTF-16 does not seem to break with the principles behind Polyglot Markup, as laid out in its introduction:
   http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html#introduction

* Permission to use UTF-16 in polyglot markup is logical, for instance because

   - UTF-16 can be reliably detected via the BOM, in both XMLand HTML5
  -  though HTML5 says that, quote: &quot;Using non-UTF-8 encodings can 
      have unexpected results on form submission and URL encodings,  
      which use the document&apos;s character encoding by default&quot;, the use of 
      non-UTF-8 probably creates form problems in XML-on-the-web
      too. Thus XML and HTML are probaly in same boat here - and 
      hence it does not seem logical to use against UTF-16 that some 
      form submission problems could occur.

* That said, the problems with non-UTF-8 *should* carry *some* 
    weight: e.g. those form submission problems could cause greater 
    problems in XML and it is a small irriation that it is not permitted/
    possible to use an  explicit character declaration in UTF-16 encoded
    documents.

However, the fact that HTML-parsers aren&apos;t required to support UTF-16, is a more fundamental nail in the coffin.  

Can it have any real-world effect? Not so much when it comes to &quot;big&quot; browsers - they support multiple encodings. But for &quot;simpllistic&quot; parsers of differnent kinds, it could probably have an effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46636</commentid>
    <comment_count>1</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2011-03-11 18:22:31 +0000</bug_when>
    <thetext>I&apos;ve removed all references to UTF-16 within the polyglot spec in the 11 March Editor&apos;s Draft.

If you log a bug against the HTML5 spec to _require_ UTF-16, please notify me.

Thanks, again, for your continued help.

Eliot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46642</commentid>
    <comment_count>2</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-03-12 17:45:08 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I&apos;ve removed all references to UTF-16 within the polyglot spec in the 11 March
&gt; Editor&apos;s Draft.

Super.

&gt; If you log a bug against the HTML5 spec to _require_ UTF-16, please notify me.

;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46822</commentid>
    <comment_count>3</comment_count>
    <who name="John Cowan">cowan</who>
    <bug_when>2011-03-18 18:59:28 +0000</bug_when>
    <thetext>Mark Davis mentioned to me that UTF-16 documents constitute less than 0.1% of the Web, so it&apos;s a fairly marginal encoding.  According to http://googleblog.blogspot.com/2010/01/unicode-nearing-50-of-web.html (which is more than a year old), the web is 70% ASCII and UTF-8, 20% 8859-1/Win1252/8859-15, and 10% for all other encodings.  Scrubbing UTF-16 is clearly the Right Thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47006</commentid>
    <comment_count>4</comment_count>
    <who name="Addison Phillips">addison</who>
    <bug_when>2011-03-28 15:32:30 +0000</bug_when>
    <thetext>The Internationalization Core WG has discussed this issue (as I18N-ISSUE-17) and has no objection to making invalid the UTF-16 character encoding for Polyglot documents. See also:

http://lists.w3.org/Archives/Public/public-i18n-core/2011JanMar/0132.html

http://www.w3.org/2011/03/23-i18n-minutes.html#item06</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53131</commentid>
    <comment_count>5</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:06:58 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53179</commentid>
    <comment_count>6</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:07:22 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>