html – Why is this HTML5 document invalid?

html – Why is this HTML5 document invalid?

Well, it depends on what you are using.

  • if you are using the File Upload option, it depends on which
    encoding the HTML file was saved with.
  • if you are using the Direct Input option, it depends on the
    navigator.

If you dont want the validator to guess, and use UTF-8, you can add the following line

<meta charset=UTF-8>

inside the the head element.

It is the Direct Input mode of the validator that defaults to UTF-8. User-agents (browsers) will default to other encodings based on a number of things:

wikipedia

If a user agent reads a document with no character encoding
information, it can fall back to using some other information. For
example, it can rely on the users settings, either browser-wide or
specific for a given document, or it can pick a default encoding based
on the users language. For Western European languages, it is typical
and fairly safe to assume Windows-1252, which is similar to ISO-8859-1
but has printable characters in place of some control codes.

html – Why is this HTML5 document invalid?

W3C validator said:

The validator checked your document with an experimental feature: HTML5 Conformance Checker. This feature has been made available for your convenience, but be aware that it may be unreliable, or not perfectly up to date with the latest development of some cutting-edge technologies.

So take some results with a pinch of salt.

Also, there is no useful fall back, the validator just needs to pick something/anything so it can try to validate for you.
W3C cant determine/decide what encoding you want/need to use. You must declare it yourself based on what characters you need to serve on your web page(s), and then ask W3C to validate your document based on that.

What editor/WYSIWYG are you using to make web pages?
Can we have the URL you are trying to validate?

Leave a Reply

Your email address will not be published.