© Leif Halvard Silli - 2010.02.09, updated 2010.02.10. New update: 2010.03.22.

Table of contents

Test of NCR support in text/HTML UAs.

This page tests the following aspects of NCR support:

1) Semicolon
Question: Does the UA always/sometimes require that the NCR is terminated with a semicolon?
2) Text
For rendered text, does the intended character render? Does replacement character show instead? Does the NCR – or bits of it – show instead?
3) Attributes
Can the NCR encoding be used inside attributes – does user agents recognize their meaning then? Is the attribute support and the text support identical?
4) Length
How long can the NCR be? (How many superfluous zeros can there be in front of the actual character number, before the NCR eventually stop working?)
5) Hexadecimal vs. decimal NCR
Are there any differences between the support for hexadecimal NCRs and decimal NCRs?
6) Not yet tested. Specifics about NCR termination
What I intend to test is whether NCRs work differently depending varius thigns such as presence/lack of whitespace after the unicode number. And does NCRs work the same way inside all attributes? I have a suspicion they don’t, but I don’t know yet. This is relevant to test both for those NCRs that do end with a semicolon and (of course) especially for those that do not end with a semicolon.

Description

The two tables below are the tests. They should be read as follows:

Tests

Table 1. Escapes with semicolon.
# illustrated ü with semicolon
Hex – üDec – ü
Number of
superfluos
zeros inside
the NCR
 0ü ü
 1 0ü ü
 2 00ü ü
 3 000ü ü
 4 0000ü ü
 5 00000ü ü
 6 000000ü ü
 7 0000000ü ü
 8 00000000ü ü
 9 000000000ü ü
10 0000000000ü ü
11 00000000000ü ü
12 000000000000ü ü
130000000000000ü ü
Table 2. Escapes without semicolon
# illustrated ü without semicolon
Hex – &#xfcDec – &#252
Number of
superfluos
zeros inside
the NCR
 0ü ü
 1 0ü ü
 2 00ü ü
 3 000ü ü
 4 0000ü ü
 5 00000ü ü
 6 000000ü ü
 7 0000000ü ü
 8 00000000ü ü
 9 000000000ü ü
10 0000000000ü ü
11 00000000000ü ü
12 000000000000ü ü
130000000000000ü ü

Results

Table of test results
UA5) Hex vs Dec1) Semicolon4) LengthComments
with without 2) Text3) Attributes
Firefox Hex100%100%100% 100%
Dec100%100%100% 100%
Opera Hex100%100%100% 100%
Dec100%100%100% 100%
Mac IE5 Hex100%100%100% 100%
Dec100%100%100% 100%
Lynx Hex100%100%100% untested
Dec100%100%100% 100%
Lobo Hex100%nil100% 100%Lobo is a Java-based browser
Dec100%nil100% 100%
IE 6, 7, 8Hex100%50% nil max 4 zeros
Dec100%100%max 4 zerosmax 4 zeros
Webkit Hex100%100%max 6 zerosmax 6 zeros
Dec100%100%max 5 zerosmax 5 zeros
Konqueror Hex100%100%max 6 zerosmax 6 zeros
Dec100%100%max 5 zerosmax 5 zeros

Conclusions

Caution: termination testing is not yet done.

The common UAs

By «common UAs», it is meant these browsers and browser families: IE, Mozilla, Webkit, Konqueror, Opera and Chrome (Chrome is assumed to behave like Webkit)

Semicolon

Length

Observations

IE aligns NCR and CSS escape length

IE: It is interesting to note that the maximum number of alphanumeric characters that IE support in a hexadecimal NCR is 6 (plus the "&#x" in the start, and ";" in the end). 6 is also the limit on the lengh of CSS escapes. IE thus perhaps made the same calculations about how long an escape needed to be, that the authors of CSS 2.1. did.

Lynx

Lobo