xhtml validation. Encoding mismatch!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

hi everyone.

I'm getting the following warning of Encodinf Mistmatch:
Quoted text here. Click to load it
different from the value in the XML declaration (utf-8). I will use the
> value
from the HTTP header (iso-8859-1).

Although, in my opinion I specify the same encoding also in the htto
Please, take a look. This is my header:
<?xml version="1.0" encoding="UTF-8"?>?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">

<html xmlns="http://www.w3.org/1999/xhtml ">
<meta http-equiv="content-type" content="application/xhtml+xml;
charset=UTF-8" />
<meta http-equiv="author" content="AUTHOR" />
<meta name="description" content="DESCRIPTION" />
<meta name="keywords" content="KEYWORDS"/>
<meta name="Content-Language" content="en">
<link rel="stylesheet" type="text/css" href="/css/style1.css" />
<link rel="stylesheet" type="text/css" href="/css/style2.css" />


Max_Us's Profile: http://www.highdots.com/forums/m1133
View this thread:

Re: xhtml validation. Encoding mismatch!

Once upon a time *Max_Us* wrote:

Quoted text here. Click to load it

The HTTP header is not what you have in the "header" of HTML pages,
it's what the server gives in response for the browsers request.

It can look something like this (differs depending on the responsing

HTTP/1.1 200 OK
Date: Thu, 20 Oct 2005 10:17:43 GMT
Server: Apache/1.3.33 (Debian GNU/Linux)
Last-Modified: Sun, 16 Oct 2005 16:44:58 GMT
Etag: "3121a-20a5-4352838a"
Accept-Ranges: bytes
Content-Length: 8357
Content-Type: text/html; charset=iso-8859-1
content-style-type: text/css

Among other things, you can see what kind of server the page is on.
There you also see what content-type and charset the server is
responding with.

If the server is configurated to serve a charset, it will overroll
whatever charset you are using on the page "header", and that's what
the validator use. If it's not configured to serve a specific charset,
your charset will be used.

Now killing all top posters and posters who don't quote
* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
* From Google: http://www.safalra.com/special/googlegroupsreply /

Re: xhtml validation. Encoding mismatch!

On Thu, 20 Oct 2005, Arne wrote:

Quoted text here. Click to load it

Indeed the HTTP "charset" (character encoding specification) has the
last word, according to RFC2616.  However, its use with
application/xml* content-types is somewhat different from the text/*
type which we are accustomed to in HTML.  (I'm using "*" as a wildcard

Quoted text here. Click to load it

"meta...http-equiv" has not the slightest meaning for content-types
of the application/xml* kind, though.  If the hon. Usenaut wants their
XML character-encoding to be taken seriously, it'll need to be in the
<?xml thingy's "encoding=" attribute.

Check the W3C documentation for the precise details.
http://www.w3.org/TR/xhtml-media-types /

The only codified exception is XHTML/1.0 "Appendix C".  The utility of
which is frequently disputed here, so I won't start that over again.


  Since XP XP2, you have the option: of having your Windows dangerously
  open, or uselessly shut.   -- Richard Bos in the Monastery

Re: xhtml validation. Encoding mismatch!

Max_Us wrote:

Quoted text here. Click to load it

Your opinion is probably wrong. I think we can trust the validator in
this respect. You do not specify the URL of the problem page. The URL
would be needed for directly checking the HTTP headers.

 > Please, take a look. This is my header:

No, it is not. What you are posting is an excerpt from the content of
your page. It is absolutely useless for deciding what the HTTP headers
are. (If you had a useful <title> and some actual content quoted, we
might have been able to google down your page and its address. But
that's not fun.)

Quoted text here. Click to load it

That fails for two reasons:
1) Such a meta tag has no effect when a document is processed
    by XHTML rules.
2) Even when a meta is noted by a client, it will lose to actual
    HTTP headers in any conflict.

Site Timeline