By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,378 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,378 IT Pros & Developers. It's quick & easy.

Validation error

P: n/a
Ray
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? They are just simple html files typed up in Notepad.
Why can't it detect them? I have tried validating both the uploaded version
and the local version and I get the same error both ways.

Ray
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ray wrote:
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. Why can't it detect them?


I would imagine that it is becuase the content type field in the http
header, XML declaration and <meta> data don't tell the validator what
character set to try.

http://www.htmlhelp.com/tools/validator/charset.html

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2

P: n/a
"Ray" <he*********@myway.com> wrote:
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?
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).
They are just simple html files typed up in Notepad.
Why can't it detect them?
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:
a.. The HTTP Content-Type field.
This is done by configuring your server. If at all possible this is
the preferred method.
b.. The XML Declaration.
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.
c.. The HTML "META" element.


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3

P: n/a
On Fri, 20 Feb 2004 11:51:14 -0600, Ray <he*********@myway.com> wrote:
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.

Frustrating, isn't it? The other respondants are right on, but I'll add
that if you go to http://validator.w3.org/file-upload.html you can upload
files and specify the charset without including it in the HTML.
(http://validator.w3.org/detailed.html allows this option with uploaded
files.)
Jul 20 '05 #4

P: n/a
"Ray" <he*********@myway.com> wrote in message
news:10*************@corp.supernews.com...
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: <trimmed>
What am I doing wrong? They are just simple html files typed up in Notepad. Why can't it detect them? I have tried validating both the uploaded version and the local version and I get the same error both ways.


Hi Ray. Here's an analogy to your post: "Dear All, My doctor has said
I'm ill and has given me a prescription (enclosed), but I want a second
opinion, so what's wrong with me? Thanks. Bye." In other words we'll
need to see the patient - a link to the uploaded version of your
webpage! :o)

However, looking at the "prescription" your webpage has no associated
'meta' information describing what the content is, so check to see if
your webserver is setting a content-type as a header, or add a meta tag
to the <head> section of the page, possibly something like: <meta
http-equiv="content-type" content="text/html" /> if it's HTML or ending
/> instead of > if it's XHTML.
--
Andrew Urquhart
Reply: http://www.andrewu.co.uk/about/conta...ewsgroup_ciwah
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.