Forum Moderators: open

Message Too Old, No Replies

HTML Validation

where to specify the character encoding

         

kiwanji

3:22 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



Just for kicks I tried to run my web page through the W3C validator and got this message:

"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:

The HTTP Content-Type field.
The XML Declaration.
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."

I am using Dreamweaver to create the page and I have no idea what I need to include to make this work. Can someone provide an example of the code cahnge I need to make?

Much thanks-

RonPK

3:30 pm on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello kiwanji,

Put this line in the head-section of your page:

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

Pick the charset you need. iso-8859-1 is standard western, iso-8859-15 more or less the same but with better support for the euro sign. These are just two charsets, there are many more out there.

kiwanji

3:55 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



Thanks for the answer but that is exactly what I have in the code of the page. Any other ideas?

BlobFisk

3:59 pm on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is this an XML or XHTML page? Have you got a correct DOCTYPE decleration?

Also, AFAIK you may need to put a / at the end of the meta decleration (not 100% sure):

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

kiwanji

4:18 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



At the top of my code Dreamweaver has inserted this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

I would assume that this means the pages are written in HTML version 4.01 - am I correct in this assumption?

I thought that I heard that DreamweaverMX was XHTML compliant but I am not 100% sure on that.

grahamstewart

10:51 pm on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thats not actually the full doctype. Although your code will validate with that tag, it will be rendered in 'quirks' mode by the browser (which is basically a mode that emulates old browser bugs).

To have it rendered in standards mode, specify the full doctype which is..


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

All on one line, at the very top of the document, above <html>.
See [alistapart.com...]

Note: thats not what is causing your content-type problem, but its an important point. ;)

More useful suggestion: try setting the character set manually on the validator for now, and see if it flags up any other problems with the html.