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

Re: Character Entity Reference for Single Quote.

From: Tim Bagot <tsb-w3-html-0002@earth.li>
Date: Fri, 26 Jan 2001 00:00:19 +0000 (UTC)
To: <www-html@w3.org>
cc: Ralph Corderoy <ralph@inputplus.demon.co.uk>
Message-ID: <Pine.LNX.4.30.0101252314030.560-100000@windle.hack>
At 2001-01-25T22:44-0000, Ralph Corderoy wrote:-

[...]
> This is accepted by the other party but they say the code could only do
> this if it knows the character set is ISO-8859-1 otherwise character
> code 39 might be something different.

This is incorrect. Numeric character references refer to ISO 10646 (which
conveniently corresponds to ISO 8859-1 for the first 256 characters)
whatever the document's character encoding, and have done since at least
HTML 2.0. Some browsers were (are?) somewhat broken in this respect, but I
would be very surprised indeed by the existence of one that broke on ASCII
characters.

> So, my question is it valid to always use &#39; in all the situations
> where &quot; is valid?  If so, using &#39; won't break the code any
> more than it might possibly already be broken.  If not, then shouldn't
> there be a &squot; character entity reference so code can work without
> knowing the value of the character?

Yes, it is valid everywhere &quot; is. XML (and hence XHTML) predefine
&apos;. HTML, it seems, does not.

Um, actually, looking at the XML recommendation, I now notice that it
_appears_ to be the case that a character reference can terminate a
literal while an entity reference cannot, so that a single quote in a
single-quote-delimited attribute value would have to be escaped as &apos;,
and not &#39;. Could someone more qualified to comment on this confirm or
refute as appropriate?

> BTW, I'm not a subscriber having found a pointer to the list but no
> subscription details so please keep me CC'd on this.

[For more information about W3C mailing lists and how to subscribe (and
unsubscribe), see <http://www.w3.org/Mail/>.]


Tim Bagot
Received on Thursday, 25 January 2001 19:00:26 GMT

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