Forum Moderators: open
The code below always used to validate and, there is a char encoding specified. So, why does the html validator say it cannot detect any char encodeing?
And more to the point, how might I fix this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Nick
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
[w3.org...]
However, this will cause IE6 to switch to quirks mode. Specify the encoding in the HTTP header. There was a thread on this some time ago.
Andreas
An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.
[w3.org...]
The HTTP is such a higher level protocol.
The W3C recommends that for backwards compatibility anyway.
In order to portably present documents with specific character encodings, the best approach is to ensure that the web server provides the correct headers.
[w3.org...]
[edited by: g1smd at 4:18 pm (utc) on Jan. 19, 2003]