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 18514 - Validator mixes up character encoding at the W20 warning
Summary: Validator mixes up character encoding at the W20 warning
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: HEAD
Hardware: PC Windows NT
: P2 normal
Target Milestone: 1.4
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 23:43 UTC by Takeshi Kurosawa
Modified: 2012-08-11 13:09 UTC (History)
1 user (show)

See Also:


Attachments
Patch 1.0 agaist mercurial tip (511 bytes, patch)
2012-08-09 23:44 UTC, Takeshi Kurosawa
Details

Description Takeshi Kurosawa 2012-08-09 23:43:41 UTC
At the W20 warning:
- The encoding specified in the meta element is treated as the value in XML declaration.
- The encoding specified in the XML declaration is not shown.

For example, in case validating following html,

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=Shift-JIS" />
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>

the warning actually shown is below:

> The character encoding specified in the XML declaration (shift-jis)
> is different from the value in the <meta> element ().
> I will use the value from the XML declaration (shift-jis) for this validation.

While expected is below:

> The character encoding specified in the XML declaration (shift_jis)
> is different from the value in the <meta> element (shift-jis).
> I will use the value from the XML declaration(shift_jis) for this validation.
Comment 1 Takeshi Kurosawa 2012-08-09 23:44:29 UTC
Created attachment 1171 [details]
Patch 1.0 agaist mercurial tip
Comment 2 Ville Skyttä 2012-08-11 13:09:19 UTC
Applied, thanks.

http://dvcs.w3.org/hg/markup-validator/rev/ce162226b857