This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2308 - an html file uploaded fails validation, same code pasted works
Summary: an html file uploaded fails validation, same code pasted works
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.7.0
Hardware: Macintosh All
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-27 21:33 UTC by Lorin Rivers
Modified: 2005-10-18 07:26 UTC (History)
0 users

See Also:


Attachments
this document fails validation, only when uploaded (533 bytes, text/html)
2005-09-27 21:34 UTC, Lorin Rivers
Details

Description Lorin Rivers 2005-09-27 21:33:49 UTC
The validate via upload reports errors that do not exist. It appears as if extra bogus characters are 
inserted in the header.

Pasting the same content into the appropriate field validates fine.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Untitled</title>
</head>
<body>
    <p>Here is some text</p>
    <p><a onclick="window.open(this.href,'_blank');return false;" href="http://mosasaur.com">Some 
Other Site</a></p>
</body>
</html>
Comment 1 Lorin Rivers 2005-09-27 21:34:51 UTC
Created attachment 393 [details]
this document fails validation, only when uploaded
Comment 2 Olivier Thereaux 2005-10-18 07:26:54 UTC
Hello Lorin,

your document (as attached) has a bogus (non-utf-8) character after encoding="utf-8"?>

The validator is right to complain about it.

The fact that the error does not appear in direct input is only thanks to the fact that the garbage character 
is not kept through copy-pasting  (thanks to your OS, clipboad and/or browser).

How to fix: just remove the first few lines until the end of the doctype, and copy-paste from a correct 
source.