473,725 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XHTML W3C validation, UTF-8 and meta tags



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 (RFC 3023) specifies a strong default of
"us-ascii" for such documents so we will use this value
regardless of any encoding you may have indicated elsewhere. If
you would like to use a different encoding, you should arrange
to have your browser send this new encoding information.

Here is my test file:

<?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 lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<!-- Test XHTML -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />
<title>Sample XHTML</title>
</head>
<body>
<div>
<a href="hello.htm l">Hello</a> again
<img src="Hello.gif" alt="Hello" height="121"
width="400"/>
<form action="bye-bye/" method="get">
<div>
<input type="hidden" name="config"/>
</div>
</form>
<ol style="LIST-STYLE-TYPE: lower-alpha">
<li>One</li>
<li>Two</li>
</ol>
</div>
<p>Some extended characters: &mdash; &alpha;   &ge;
</p>
</body>
</html>

Jul 20 '05 #1
21 8456


Zenobia wrote:

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 (RFC 3023) specifies a strong default of
"us-ascii" for such documents so we will use this value
regardless of any encoding you may have indicated elsewhere. If
you would like to use a different encoding, you should arrange
to have your browser send this new encoding information.

Here is my test file:

<?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 lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<!-- Test XHTML -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />


Your are using the file upload validation, right? I am afraid that if
you want to validate your XHTML then you are better off if you first
upload the file via FTP to a public HTTP server and then validate by
giving the URL to the W3C validator. Then the W3C validator reads the
XML declaration I think to find the encoding and you don't get that warning.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2


Zenobia wrote:

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 (RFC 3023) specifies a strong default of
"us-ascii" for such documents so we will use this value
regardless of any encoding you may have indicated elsewhere. If
you would like to use a different encoding, you should arrange
to have your browser send this new encoding information.

Here is my test file:

<?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 lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<!-- Test XHTML -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />


Your are using the file upload validation, right? I am afraid that if
you want to validate your XHTML then you are better off if you first
upload the file via FTP to a public HTTP server and then validate by
giving the URL to the W3C validator. Then the W3C validator reads the
XML declaration I think to find the encoding and you don't get that warning.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
On Sun, 11 Apr 2004, Zenobia wrote:
What meta-tags should I be including?
Probably the wrong question. HTTP protocol doesn't consist of "meta
tags".
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).
I take it that you submitted your content for validation by uploading
a local file, rather than by giving the validator a URL which it could
access on your own system?

The validator is warning you that it received the submission without
the browser telling it what character encoding ("charset") the browser
thought it was using. This is actually quite common browser
behaviour, for legacy reasons, although by rights - as the validator
is explaining to you - the recipient is entitled to assume us-ascii in
this context unless the browser explicitly tells it otherwise.

In this particular instance, where your source code in fact contains
only us-ascii characters, the warning is harmless. Since us-ascii is
a subset of utf-8 encoding, you're doing no harm by letting XML
believe that it's utf-8.

You could fool the validator by renaming the local file to imply HTML
rather than XML. It's a bit of a juggling act, due to the messy
consequences of the W3C trying to achieve the impossible and make a
seamless transition to XHTML - and making matters a lot worse than if
they'd insisted on the big bang right from the outset. The notorious
"XHTML/1.0 Appendix C" is only part of this mess.

Or more usefully (and especially if you want others to help you
constructively) , you could put the test material on a web-accessible
server (checking that the server sends an appropriate HTTP content
header when it serves the content out), and then submit it by URL
rather than by upload.
Here is my test file:


Yes, but that doesn't really help, since if I save that as foobar.html
and submit it, there's no complaints from the validator.

However, if I rename it to foobar.xml and submit -that-, then the
validator pops up with this warning.

Unfortunately, it seems that the validator folk have implemented this
intended-to-be-informative warning without actually getting around to
documenting it. At least, I couldn't find any further explanation in
their documentation (nor could Google, though it found a couple of
useful discussions on the mailing list archives)[1]

Other contributors may get different effects depending on which
browser they use, and how their browser/ filename-extension/
content-type mappings are set.

It really is much preferable (as repeatedly recommended on this group)
if you can put your specimen on a web server, and tell the hon
Usenauts its URL.

good luck

[1] As a general tip: don't be afraid to type error message fragments
verbatim into Google when you're in doubt as to what they mean. In
this case, it wasn't as helpful as it might be, but in general it
rates to give you a quick answer without waiting for a response from
usenet.
Jul 20 '05 #4
On Sun, 11 Apr 2004, Zenobia wrote:
What meta-tags should I be including?
Probably the wrong question. HTTP protocol doesn't consist of "meta
tags".
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).
I take it that you submitted your content for validation by uploading
a local file, rather than by giving the validator a URL which it could
access on your own system?

The validator is warning you that it received the submission without
the browser telling it what character encoding ("charset") the browser
thought it was using. This is actually quite common browser
behaviour, for legacy reasons, although by rights - as the validator
is explaining to you - the recipient is entitled to assume us-ascii in
this context unless the browser explicitly tells it otherwise.

In this particular instance, where your source code in fact contains
only us-ascii characters, the warning is harmless. Since us-ascii is
a subset of utf-8 encoding, you're doing no harm by letting XML
believe that it's utf-8.

You could fool the validator by renaming the local file to imply HTML
rather than XML. It's a bit of a juggling act, due to the messy
consequences of the W3C trying to achieve the impossible and make a
seamless transition to XHTML - and making matters a lot worse than if
they'd insisted on the big bang right from the outset. The notorious
"XHTML/1.0 Appendix C" is only part of this mess.

Or more usefully (and especially if you want others to help you
constructively) , you could put the test material on a web-accessible
server (checking that the server sends an appropriate HTTP content
header when it serves the content out), and then submit it by URL
rather than by upload.
Here is my test file:


Yes, but that doesn't really help, since if I save that as foobar.html
and submit it, there's no complaints from the validator.

However, if I rename it to foobar.xml and submit -that-, then the
validator pops up with this warning.

Unfortunately, it seems that the validator folk have implemented this
intended-to-be-informative warning without actually getting around to
documenting it. At least, I couldn't find any further explanation in
their documentation (nor could Google, though it found a couple of
useful discussions on the mailing list archives)[1]

Other contributors may get different effects depending on which
browser they use, and how their browser/ filename-extension/
content-type mappings are set.

It really is much preferable (as repeatedly recommended on this group)
if you can put your specimen on a web server, and tell the hon
Usenauts its URL.

good luck

[1] As a general tip: don't be afraid to type error message fragments
verbatim into Google when you're in doubt as to what they mean. In
this case, it wasn't as helpful as it might be, but in general it
rates to give you a quick answer without waiting for a response from
usenet.
Jul 20 '05 #5
"Zenobia" <5.**********@s pamgourmet.com> wrote in message
news:b6******** *************** *********@4ax.c om...
I can't understand the warning I'm getting 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). .... Here is my test file:

<?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 lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<!-- Test XHTML -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />


Try <meta http-equiv="content-type" content="text/html; charset=utf-8" />
In general XHTML doesn't like to get uppercase parameters.
Jul 20 '05 #6
"Zenobia" <5.**********@s pamgourmet.com> wrote in message
news:b6******** *************** *********@4ax.c om...
I can't understand the warning I'm getting 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). .... Here is my test file:

<?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 lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<!-- Test XHTML -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />


Try <meta http-equiv="content-type" content="text/html; charset=utf-8" />
In general XHTML doesn't like to get uppercase parameters.
Jul 20 '05 #7
In article <b6************ *************** *****@4ax.com>,
Zenobia <5.**********@s pamgourmet.com> writes:
fully satisfied with. What meta-tags should I be including?


None. It's warning that HTTP rules take precedence over XML rules,
and your document will be treated as us-ascii regardless of what
you put in it, because that's what your browser said.

You might be able to fix it in your browser configuration, or
work around it by removing the xmldecl and/or giving your file a
..html "extension" . If your browser uploads it as text/html, then
the validator will apply HTML rules so your charset declaration
will be used in the absence of one from the browser.

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 20 '05 #8
In article <b6************ *************** *****@4ax.com>,
Zenobia <5.**********@s pamgourmet.com> writes:
fully satisfied with. What meta-tags should I be including?


None. It's warning that HTTP rules take precedence over XML rules,
and your document will be treated as us-ascii regardless of what
you put in it, because that's what your browser said.

You might be able to fix it in your browser configuration, or
work around it by removing the xmldecl and/or giving your file a
..html "extension" . If your browser uploads it as text/html, then
the validator will apply HTML rules so your charset declaration
will be used in the absence of one from the browser.

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 20 '05 #9
JotM <ja*****@12move .netherlands> wrote:
Try <meta http-equiv="content-type" content="text/html;
charset=utf-8" /> In general XHTML doesn't like to get uppercase
parameters.


Please elaborate.

--
David Håsäther
Jul 20 '05 #10

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

Similar topics

15
4377
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
15142
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 -...
11
4208
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural way? -tt.
22
2864
by: Gianni Rondinini | last post by:
hi all. please excuse the misusage of some tech terms, but writing in english is not as easy as in italian :) i'm designing our new website and, since i want to do something that will last as long as possible and since i'm not in a hurry at all, i wanted to use the most up-to-date authoring language. i use quite a lot html 4.01 in the past, then i recently read carefully the xhtml 1.0 specifications on the w3.org website --just few...
9
3137
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a lot of research in the areas of XHTML and WAI compliance, and am attempting to come up with a recommendation for our product in terms of standards level compliance. Ideally, I would like to be at XHTML 1.0 Strict. However, in my reading I have...
5
3957
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...
7
3072
by: C.W.Holeman II | last post by:
For info on the context of my question see the end of this posting. From http://www.w3.org/TR/XHTMLplusMathMLplusSVG/: How can I validate the result of client-side XSLT transform which has the following? <xsl:output method="xml"
1
3831
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"
0
1069
tjc0ol
by: tjc0ol | last post by:
Basically for xhtml 1.0 strict is charset="utf-8" but in my case the w3c validator although my website passed in validation but has error regarding this error: "Byte-Order Mark found in UTF-8 File. The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported. " What is the best way to remove that...
10
2074
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet type="text/css" href="proj_default.css" title="ss_default"> <title>Testing html</title> </head>
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9179
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
9116
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
8099
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...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.