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

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 things, 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 ü directlyü  ü ü  ü
 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 ü directlyü  ü ü  ü
 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) Length5) semicolon
inside alt="*"
Comments
with without 2) Text3) class attr.
Firefox HexbothunlimitedbothGUI UA
Dec
Opera Hex
Dec
Mac IE5 Hex
Dec
LynxHexunlimiteduntestedtext-mode browser
Dec
Lobo HexwithnilUnlimitedwith sem.
col. only
GUI UA (Java-based)
Dec
IE 6, 7, 8Hexwithonly in attributesmax 4 zerosbothGUI UA
Decboth
Webkit Hexmax 6 zeros
Decmax 5 zeros
Konqueror Hexmax 6 zeros
Decmax 5 zeros
elinksHexmax 6 zerosuntested text-mode browser
Dec max 7 zeros
linksHexmax 2 zerosuntested
Dec
w3mHexulimiteduntested
Dec
netrikHexMy copy (version 1.15.3) only displayed NCRs as
questionmarks – regardless of length or semicolon
(indicates bug or misconfig).
???
Dec ???
retawqHexbothmax 2 zerosuntestedbothtext-mode browser
NB! The «supported» NCRs was
displayed as question marks – probably a
sign of lack of configuration
Dec max 1 zero
Tkhtml 3HexUnlimitedGUI UA (TCL/TK based)
Dec
Dillo (v. 0.8.6)HexGUI UA
Dec

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