"Ray" <heylonghair@myway.com> wrote:
[color=blue]
>I've got a couple of webpages that I am trying to validate but I get this
>error message when trying to validate them with the
www.w3.org HTML
>validator:
>I was not able to extract a character encoding labeling from any of the
>valid sources for such information. Without encoding information it is
>impossible to validate the document. The sources I tried are:
>
> a.. The HTTP Content-Type field.
> b.. The XML Declaration.
> c.. The HTML "META" element.
>And I even tried to autodetect it using the algorithm defined in Appendix F
>of the XML 1.0 Recommendation.
>
>Since none of these sources yielded any usable information, I will not be
>able to validate this document. Sorry. Please make sure you specify the
>character encoding in use.
>
>What am I doing wrong?[/color]
You're not telling the validator (or any other user agent - such as
your visitors' browsers) what the character encoding used by your
pages is. That information is needed to validate the page (it's also
needed to render the page, but browsers have defaults/make guesses).
[color=blue]
>They are just simple html files typed up in Notepad.
>Why can't it detect them?[/color]
It's detecting your pages just fine. It just can't validate them
without a bit more information.
You can provide this information in one of three ways, as the error
message says:
[color=blue]
> a.. The HTTP Content-Type field.[/color]
This is done by configuring your server. If at all possible this is
the preferred method.
[color=blue]
> b.. The XML Declaration.[/color]
This only applies to XHTML, goes before the doctype declaration right
at the start of your code and takes this form:
<?xml version="1.0" encoding="ISO-8859-1"?>
Replacing ISO-8859-1 with whatever character encoding you are using.
Note that including this declaration will cause IE to enter Quirks
mode regardless of the doctype, and thus this is often best avoided.
[color=blue]
> c.. The HTML "META" element.[/color]
The least preferred method, include the following in the head of your
page:
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
Again, replacing ISO-8859-1 with whatever character encoding you are
using.
If you are validating pages that will later move to a server which
sends out proper character encoding information then you can
temporarily emplouy and over ride by using teh validator's extended
interface:
http://validator.w3.org/detailed.html and choosing your
encoding from the menu provided.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>