RE: Use of Symbols

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: £

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 UTC