Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 06:46 PM
Ray
Guest
 
Posts: n/a
Default Validation error

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


  #2  
Old July 20th, 2005, 06:46 PM
David Dorward
Guest
 
Posts: n/a
Default Re: Validation error

Ray wrote:
[color=blue]
> 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.[/color]
[color=blue]
> Why can't it detect them?[/color]

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/>
  #3  
Old July 20th, 2005, 06:46 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Validation error

"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/>
  #4  
Old July 20th, 2005, 06:46 PM
Neal
Guest
 
Posts: n/a
Default Re: Validation error

On Fri, 20 Feb 2004 11:51:14 -0600, 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.[/color]


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.)
  #5  
Old July 20th, 2005, 06:49 PM
Andrew Urquhart
Guest
 
Posts: n/a
Default Re: Validation error

"Ray" <heylonghair@myway.com> wrote in message
news:103ci8ga54p47ef@corp.supernews.com...[color=blue]
> I've got a couple of webpages that I am trying to validate but I get[/color]
this[color=blue]
> error message when trying to validate them with the www.w3.org HTML
> validator:[/color]
<trimmed>
[color=blue]
> What am I doing wrong? They are just simple html files typed up in[/color]
Notepad.[color=blue]
> Why can't it detect them? I have tried validating both the uploaded[/color]
version[color=blue]
> and the local version and I get the same error both ways.[/color]

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


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles