<?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>1762</bug_id>
          
          <creation_ts>2005-07-19 22:58:50 +0000</creation_ts>
          <short_desc>UTF-8 BOM in XHTML breaks CSS validator</short_desc>
          <delta_ts>2007-06-28 00:43:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSSValidator</product>
          <component>XHTML1.0</component>
          <version>CSS Validator</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/International/tests/test-utf8-signature/withbom-nocharset.html</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="Cory Nelson">phrosty</reporter>
          <assigned_to name="Olivier Thereaux">ot</assigned_to>
          
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4941</commentid>
    <comment_count>0</comment_count>
    <who name="Cory Nelson">phrosty</who>
    <bug_when>2005-07-19 22:58:50 +0000</bug_when>
    <thetext>A UTF-8 BOM in XHTML breaks the CSS validator, see the &quot;Valid CSS&quot; link at the
bottom of the URL provided.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4943</commentid>
    <comment_count>1</comment_count>
    <who name="Bj">bjoern</who>
    <bug_when>2005-07-19 23:11:20 +0000</bug_when>
    <thetext>Indeed (in fact, that&apos;s probably a known issue, but I am not sure whether 
someone filed a bug already). We might be able to fix this by upgrading to a 
more recent version of Xerces.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4992</commentid>
    <comment_count>2</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2005-07-20 10:10:55 +0000</bug_when>
    <thetext>Xerces version is currently 2.6.2, can you check again?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4994</commentid>
    <comment_count>3</comment_count>
    <who name="Bj">bjoern</who>
    <bug_when>2005-07-20 12:05:41 +0000</bug_when>
    <thetext>Okay, it seems this happens if Content-Type:text/html with no charset parameter 
and a BOM. So this is probably the result of how the HTML parser with its XHTML 
sniffing interact with xerces. The Validator might be transcoding to UTF-8 
before it passes the document to Xerces and in a character stream a bom may 
indeed not appear. It seems to work for application/xhtml+xml and text/html 
with a charset parameter in the HTTP header.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4995</commentid>
    <comment_count>4</comment_count>
    <who name="Cory Nelson">phrosty</who>
    <bug_when>2005-07-20 13:14:12 +0000</bug_when>
    <thetext>that did it - declared it as utf-8 in the http header and it now works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5137</commentid>
    <comment_count>5</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2005-07-22 10:13:10 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Okay, it seems this happens if Content-Type:text/html with no charset parameter 
&gt; and a BOM. So this is probably the result of how the HTML parser with its XHTML 
&gt; sniffing interact with xerces. The Validator might be transcoding to UTF-8 
&gt; before it passes the document to Xerces and in a character stream a bom may 
&gt; indeed not appear. It seems to work for application/xhtml+xml and text/html 
&gt; with a charset parameter in the HTTP header.

The current code does this
if the mime type has a charset parameter use it,
if not, then if the mime type is text/html -&gt; use iso-8859-1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13941</commentid>
    <comment_count>6</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-02-09 17:45:50 +0000</bug_when>
    <thetext>changing URL to be test case on i18n web site</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15712</commentid>
    <comment_count>7</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-06-28 00:43:13 +0000</bug_when>
    <thetext>switching to tagsoup library as html parser has made this issue moot.
(there are still issues with BOM-toting CSS files, but will open another bug for them)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>