473,668 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="applic ation/xhtml+xml;
charset=UTF-8" />
<meta http-equiv="author" content="AUTHOR " />
<meta name="descripti on" content="DESCRI PTION" />
<meta name="keywords" content="KEYWOR DS"/>
<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 4137
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="applic ation/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...htt p-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
2408
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 version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
15
4373
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 XML part) the document validates fine. Does anyone have an idea how to solve this problem without changing the characters to #xxx; or &oslash; I've triede with UTF-8. ************************************************** <?xml version="1.0"...
76
15112
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 and the ones around it are illegal - then, after resubmission it flags no errors. So, are there any illegal characters between 0 and 255 in the UTF-8 character set or is it just my imagination that the W3C validation parser thinks there are -...
21
8449
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 warning I got from the W3C validator. Note: The HTTP Content-Type header sent by your web browser (unknown) did not contain a "charset" parameter, but the Content-Type was one of the XML text/* sub-types (text/xml). The relevant specification...
9
2333
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 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> When I change the DOCTYPE to (what should be the equivalent):
5
3955
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 javascript:Chat=void(window.open('http://www.shiachat.com/forum/chat.html','Chat','resizable=1,status=1,width=800,height=620,top=0,left=0')) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
3
1753
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 information about the first part - like the location of that content or some other info on different constituents of the first part The elements of the second part are defined by an XML schema.
1
3828
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. http://emle.sourceforge.net/emle020100/lab/ng20070625_emle_lab_001-e.xml.html <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
3
2858
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 ?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" xmlns:v="urn:schemas-microsoft-com:vml" > page. Plus, it...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8572
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8652
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.