Re: For review: Character encodings in HTML and CSS

John Cowan, Wed, 10 Feb 2010 02:38:50 -0500:
> Leif Halvard Silli scripsit:
> 
>> (1) It should be mentioned that in SGML based mark-up, such as HTML4, 
>> one may omit the ";" in NCRs. All the big 6 (IE, Firefox, Opera, 
>> Webkit, Konqueror, Chrome [assuming it is like Webkit]) desktop 
>> browsers supports this _inside attributes_.   (I have a quite thorough 
>> test document here: <http://målform.no/ncr-test/> ) They also all 
>> support it for text, except that IE has an exception when it comes to 
>> NCRs directly in text: Then, for hex NCRs, IE requires semicolons, 
>> while for decimal NCRs it does not require it. [IE got support for hex 
>> NCRs later on, didn't it? Must be a bug ... !] So one could give the 
>> usage advice that is "better" and simpler to use the semicolon than to 
>> avoid it. But still tell that it is permitted to drop it. (My view is 
>> that it should be permitted in HTML5 too.) Another part of the advice 
>> could be that it is safer - and more justified - to use inside machine 
>> readable attributes than inside human readable text.
> 
> On the contrary, I would not document that you can drop it, particularly
> when you can't always.

Everyone talks talks the semicolon. But no one talks about the issue 
that really matters: The length of the escape string.

I know that it can't always be dropped - wasn't that clear? My advice 
is to limit its use to attributes - where one also might have a 
particular reason for wanting to be incompatible with some user agent - 
the adventure of targeting particular browsers - in order to save 
oneself from /other/ bugs. Either that, or one could say that one 
should limit this use to decimal NCRs - then one is 100% covered w.r.t. 
IE (because I don't know if we can count in such things as Lobo).

You just said that named entities doesn't work in a compatible way i 
XHTML. So, at least XHTML cannot be a reason to not document that 
dropping semicolon is compatible with HTML4.

All UAs  - except at least perhaps new ones (like the Lobo browser, 
which started in 2005 -  "with the aim to fully support HTML 4,") - 
seem to have support for dropping the ";".

I can tell you that I was very puzzled to find out that there is such 
wide support for dropping the ";", given the many advices to not drop 
it.
-- 
leif halvard silli

Received on Wednesday, 10 February 2010 13:25:10 UTC