W3C home > Mailing lists > Public > www-html@w3.org > January 2002

RE: Use of Symbols

From: Christian Wolfgang Hujer <Christian.Hujer@itcqis.com>
Date: Mon, 14 Jan 2002 11:52:36 +0100
To: "Geoff McNeil" <g.mcneil1@ntlworld.com>, <www-html@w3.org>
Message-ID: <000401c19ce9$94212e00$2a95e23e@andromedacwh>
Hello Geoff,

> -----Original Message-----
> From: www-html-request@w3.org [mailto:www-html-request@w3.org]On Behalf Of
Geoff McNeil
> Sent: Friday, January 11, 2002 5:26 PM
> To: www-html@w3.org
> Subject: Use of Symbols
>
>
> On trying to validate my document i keep getting an error due to my use of
the  sign.  Is there a code i should be using or another way of displaying
this image on my documents?


what charset have you used for encoding your document, and what charset have
you declared for your document? If it is not iso-8859-1 or a similar in both
cases, the well-formedness check of the validator will fail.

Usually the pound sign may not occur unencoded in an XML or HTML document,
it needs to be encoded using a character entity like this: &#163;

It is a good advice to always encode all non-ASCII-characters (ASCII is a 7
Bit encoding, ranging from ASCII/most ISO/Unicode characters 0-127) using
character entities, at least when the language used in the document mainly
uses a writing based on the latin alphabet. If the language for the document
does not use a writing based on the latin alphabet, using UTF-8 encoded
Unicode is a good alternative.

The charset you use must be declared like this (iso-8859-1 used for these
examples):

HTML 4.01:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Example of charset and pound sign</title>
	</head>
	<body>
		<h1>Example of charset and pound sign</h1>
		<h2>Encoded pound sign</h2>
		<p>
			The web browser iBrowse 2.2 for Amiga currently costs &#163;34.95 at <a
href="http://www.hisoft.co.uk">HiSoft</a>.
		</p>
		<h2>Native pound sign</h2>
		<p>
			The web browser iBrowse 2.2 for Amiga currently costs 34.95 at <a
href="http://www.hisoft.co.uk">HiSoft</a>.
		</p>
		<!--
			The native pound sign is only allowed because of the charset declaration
in the meta element.
		-->
	</body>
</html>


XHTML (Basic 1.0)
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xml:lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Example of charset and pound sign</title>
	</head>
	<body>
		<h1>Example of charset and pound sign</h1>
		<h2>Encoded pound sign</h2>
		<p>
			The web browser iBrowse 2.2 for Amiga currently costs &#163;34.95 at <a
href="http://www.hisoft.co.uk">HiSoft</a>.
		</p>
		<h2>Native pound sign</h2>
		<p>
			The web browser iBrowse 2.2 for Amiga currently costs 34.95 at <a
href="http://www.hisoft.co.uk">HiSoft</a>.
		</p>
		<!--
			The native pound sign is only allowed because of the encoding pseudo
attribute in the xml declaration.
			It is a good advice to keep the charset/encoding information redundant
and still additionally declare the charset in a meta element for backwards
compatibility of XHTML documents with non-X(HT)ML-browsers. Of course both,
the encoding declaration and the charset declaration must denote the same
encoding/charset.
		-->
	</body>
</html>


Beware not to use these "cp..." or "...windows..." charsets because these
are not just legacy charsets, these are proprietary charsets and won't be
understood by most browsers.
iso-8859-*, though still often in use, already is considered to be a legacy
charset. The future definitely is UTF-8 and UTF-16.


I hope these informations will be helpful for you to avoid your problem now
and in future.



Greetings and have a nice day.

Christian Hujer
Received on Monday, 14 January 2002 05:55:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:50 GMT