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 20307 - in HTML should warn when title precedes meta@charset
Summary: in HTML should warn when title precedes meta@charset
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-08 14:27 UTC by Daniel.S
Modified: 2015-08-23 07:07 UTC (History)
1 user (show)

See Also:


Attachments

Description Daniel.S 2012-12-08 14:27:22 UTC
There should be a warning when a title element precedes the meta@charset element, because the charset information may be ignored (or trigger a re-decoding) if the title element already contains 'special' or multibyte characters.

This is a very widespread issue, at least for beginners but often experts as well.

A warning in that case could help educate authors.

Note that validator.nu reports an error for this document:

<!DOCTYPE html>
<html>
<head>
 <title>äöü</title>
 <meta charset="iso-8859-1">
</head>
<body>
<h1>äöü</h1>
</body>
</html>
Comment 1 Michael[tm] Smith 2012-12-08 14:43:00 UTC
(In reply to comment #0)
> Note that validator.nu reports an error for this document:
> 
> <!DOCTYPE html>
> <html>
> <head>
>  <title>äöü</title>
>  <meta charset="iso-8859-1">
> </head>
> <body>
> <h1>äöü</h1>
> </body>
> </html>

Yeah, if you put validate it by pasting it into the textarea. That's just because it treats all textarea input as UTF-8. But if you take that same document and instead put it up on the Web and serve it with a iso-8859-1 charset in the content-type header, you won't get an error (you'll get a warning but that's a different story).
Comment 2 Daniel.S 2012-12-08 15:27:12 UTC
(In reply to comment #1)
> Yeah, if you put validate it by pasting it into the textarea. That's just
> because it treats all textarea input as UTF-8.

I didn't do that. Sorry for being ambiguous.

I have created an html document which is iso-8859-1 encoded and used the file upload feature at validator.nu

This results in one warning:
> Warning: Using windows-1252 instead of the declared encoding iso-8859-1.

And one error:
> Error: No explicit character encoding declaration has been seen yet (assumed
> windows-1252) but the document contains non-ASCII.
> <head>↩ <title>äöü</title>↩ <m

I think this is a useful error that the W3 Validator should report as well.

> But if you take that same document and instead put it up on the Web and
> serve it with a iso-8859-1 charset in the content-type header, you won't get
> an error (you'll get a warning but that's a different story).

I get your point: However, some servers do not send any encoding information at all and there are use cases where a HTTP header is simply not available (local documents for example).
Comment 3 Michael[tm] Smith 2013-04-21 01:25:36 UTC
(In reply to comment #2)
> I have created an html document which is iso-8859-1 encoded and used the
> file upload feature at validator.nu
> 
> This results in one warning:
> > Warning: Using windows-1252 instead of the declared encoding iso-8859-1.
> 
> And one error:
> > Error: No explicit character encoding declaration has been seen yet (assumed
> > windows-1252) but the document contains non-ASCII.
> > <head>↩ <title>äöü</title>↩ <m
> 
> I think this is a useful error that the W3 Validator should report as well.

Please make sure to use http://validator.w3.org/nu/ directly instead of http://validator.w3.org/

There are a number of known issues with the post-processing that http://validator.w3.org does on the output from the HTML5 checker (validator.nu backend). It's not within my purvey to fix those problems; I can only deal directly with any problems that are reproducible at http://validator.w3.org/nu/

So if you can reproduce this problem at http://validator.w3.org/nu/ please got ahead and reopen this bug.
Comment 4 Daniel.S 2013-04-21 07:17:30 UTC
Thanks for your reply.

(In reply to comment #3)
> Please make sure to use http://validator.w3.org/nu/ directly instead of
> http://validator.w3.org/

Sorry, I don't understand. I thought this is the Bugzilla for the W3 service and not for the Nu Validator.

> There are a number of known issues with the post-processing that
> http://validator.w3.org does on the output from the HTML5 checker
> (validator.nu backend). It's not within my purvey to fix those problems; I
> can only deal directly with any problems that are reproducible at
> http://validator.w3.org/nu/

I didn't know W3 uses Nu as the backend for HTML5 validation. There doesn't seem to be an obvious indicator.
Can you please tell me where to report bugs within http://validator.w3.org itself?
Comment 5 Michael[tm] Smith 2013-04-21 09:22:37 UTC
(In reply to comment #4)
> Thanks for your reply.
> 
> (In reply to comment #3)
> > Please make sure to use http://validator.w3.org/nu/ directly instead of
> > http://validator.w3.org/
> 
> Sorry, I don't understand. I thought this is the Bugzilla for the W3 service
> and not for the Nu Validator.

http://validator.w3.org/nu/ is the current validator service. It is the only W3C validator service that's being actively maintained, and that has any new bug fixes going into it. It is called the "W3C Nu Markup Validation Service".

http://validator.w3.org/ is the legacy validator service. I do not work on the code for that. Nobody does any longer, because it's not being actively maintained. It has a feature that allows checking of HTML5 documents, but all that feature does is that it calls the http://validator.w3.org/nu/ service behind the scenes.

> 
> > There are a number of known issues with the post-processing that
> > http://validator.w3.org does on the output from the HTML5 checker
> > (validator.nu backend). It's not within my purvey to fix those problems; I
> > can only deal directly with any problems that are reproducible at
> > http://validator.w3.org/nu/
> 
> I didn't know W3 uses Nu as the backend for HTML5 validation. There doesn't
> seem to be an obvious indicator.
> Can you please tell me where to report bugs within http://validator.w3.org
> itself?

If they are errors about how it handles HTML5 documents, nowhere. Because the only service for which HTML5 checking is now supported is http://validator.w3.org/nu/ So if you want to check HTML5 documents, use http://validator.w3.org/nu/ directly. Or even if you want to check HTML4 documents -- it can check those fine too.

Don't use http://validator.w3.org/
Comment 6 Daniel.S 2013-04-23 11:50:56 UTC
(In reply to comment #5)
> http://validator.w3.org/nu/ is the current validator service. It is the only
> W3C validator service that's being actively maintained, and that has any new
> bug fixes going into it. It is called the "W3C Nu Markup Validation Service".

Thanks for explaining.

> http://validator.w3.org/ is the legacy validator service. I do not work on
> the code for that. Nobody does any longer, because it's not being actively
> maintained. It has a feature that allows checking of HTML5 documents, but
> all that feature does is that it calls the http://validator.w3.org/nu/
> service behind the scenes.

I don't think that there are a lot of people who are actually aware of this.

> If they are errors about how it handles HTML5 documents, nowhere. Because
> the only service for which HTML5 checking is now supported is
> http://validator.w3.org/nu/ So if you want to check HTML5 documents, use
> http://validator.w3.org/nu/ directly. Or even if you want to check HTML4
> documents -- it can check those fine too.
> 
> Don't use http://validator.w3.org/

I'm a little shocked by the obviousness your statment implies.

This is the first time I hear about this state of http://validator.w3.org/
Please tell me if I'm living in an ivory tower, but I don't know anyone who's using http://validator.w3.org/nu/ or even advocate its use (few use validator.nu though).

A lot of questions come to my mind, for example, why is there no public or official note in this? What are the future plans for http://validator.w3.org/? Are there any? I didn't do an in-depth search, but the impact of this information appears so to be so big that it should be easily discoverable.

Well, I'll start to use and advocate http://validator.w3.org/nu/ from now on.

If you got any answers for me, it'd be ok to send them to me privately if you feel they don't belong to this place. Again, thanks for explaining.
Comment 7 Michael[tm] Smith 2013-04-23 12:15:52 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Don't use http://validator.w3.org/
> 
> I'm a little shocked by the obviousness your statement implies.
> 
> This is the first time I hear about this state of http://validator.w3.org/
> Please tell me if I'm living in an ivory tower, but I don't know anyone
> who's using http://validator.w3.org/nu/ or even advocate its use (few use
> validator.nu though).

Yeah, we need to do a better job of getting the word out.

> A lot of questions come to my mind, for example, why is there no public or
> official note in this?

Because I've not been able to get consensus for some others about it.

> What are the future plans for
> http://validator.w3.org/?

The current validator backend at the URL will eventually be retired and moved to http://validator.w3.org/classic or somewhere. And the validator.nu backend will be moved from http://validator.w3.org/nu/ to replace it and become the new http://validator.w3.org/


> Are there any? I didn't do an in-depth search, but
> the impact of this information appears so to be so big that it should be
> easily discoverable.

Again, I need to do a better job of getting the word out on this.
 
> Well, I'll start to use and advocate http://validator.w3.org/nu/ from now on.

Thanks