473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

xhtml validation. Encoding mismatch!


hi everyone.

I'm getting the following warning of Encodinf Mistmatch:
Character Encoding mismatch!

The character encoding specified in the HTTP header (iso-8859-1) is
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
header. 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">
<head>
<title>TITLE</title>
<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" />
</head>

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

Oct 20 '05 #1
3 4119
Max_Us wrote:
The character encoding specified in the HTTP header (iso-8859-1) is
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
header.


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.)
<meta http-equiv="content-type" content="application/xhtml+xml;
charset=UTF-8" />


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.
Oct 20 '05 #2
Once upon a time *Max_Us* wrote:
hi everyone.

I'm getting the following warning of Encodinf Mistmatch:
Character Encoding mismatch!

The character encoding specified in the HTTP header (iso-8859-1) is
different from the value in the XML declaration (utf-8). I will use the
value from the HTTP header (iso-8859-1).


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
server)

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.

--
/Arne
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/
-------------------------------------------------------------
Oct 20 '05 #3
On Thu, 20 Oct 2005, Arne wrote:
If the server is configurated to serve a charset, it will overroll
whatever charset you are using on the page "header",
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
there).
If it's not configured to serve a specific charset,
your charset will be used.


"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
Oct 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Greg | last post by:
Hi everybody, so, I would like to use XML files for some parts of my website. I would like to respect W3C XHTML 1.1 recommendation. Then, I have these two docs : o My XML file: <?xml...
15
by: Nicolai Pedersen | last post by:
I have a problem validating a simple piece of XHTML containing danish characters. Trying to validate the following piece of XHTML gives the error mentioned beneath. If I remove the first line (the...
76
by: Zenobia | last post by:
How do I display character 151 (long hyphen) in XHTML (utf-8) ? Is there another character that will substitute? The W3C validation parser, http://validator.w3.org, tells me that this character...
21
by: Zenobia | last post by:
I can't understand the warning I'm getting from the W3C validator. Here it is, along with the source code that it is not fully satisfied with. What meta-tags should I be including? Here is the...
9
by: rbronson1976 | last post by:
Hello all, I have a very strange situation -- I have a page that validates (using http://validator.w3.org/) as "XHTML 1.0 Strict" just fine. This page uses this DOCTYPE: <!DOCTYPE html PUBLIC...
5
by: Bhaiyyah | last post by:
I am repetitively failing to login with any user name for XHTML Chat. Here is some info I copied from view source: Link: http://www.shiachat.com/forum/chat.html ...
3
by: dantohester | last post by:
Hi there, I have the following situation: I want to create an XML document that contains 2 parts: a) a XHTML part (it can be either version 1.0 or 1.1 ) b) a non XHTML part that contains some...
1
by: C.W.Holeman II | last post by:
I have an xmlns attribute that produces an XHTML validation error and I do not understand why it is considered an error.The file displays as expected on Firefox and IE7. ...
3
by: jwgrafflin | last post by:
The following code works just fine on my <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> page, but won't work on my ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.