HTML Special Characters and Browser Compatibility
June 10, 2002
|
HTML 4 includes around 250 special characters, or character
entities, such as § ± ¶ and ‡. But which
ones work in Explorer 5 and Netscape 4, and which ones only
show up in IE6 or N6? Andrew Starling goes on a browser
compatibility hunt, scattering all 250 in the breeze to
find out where they land.
|
HTML version 4, which is the version most of use every day,
includes roughly 250 special characters. Here are some examples:
§ ± ¶ ‡. When you need to use a weird
symbol, or an Icelandic letter or a Greek mathematical symbol,
you may find it's included in the 250. But will it work in all
the popular browsers?
There lies the catch. The most common special characters do work
in the majority of browsers. But there are some that work in
Internet Explorer but not in Netscape Navigator (version 4).
And there are some that work in IE6 but not IE5, unless, perhaps,
it's IE5 on a Mac. Then there's Netscape 6, which is the one
browser that can read pretty much every HTML 4 special character.
And finally, there are even a couple of special characters that
no browser appears to be able to read. Hmmm, useful..
In this article we'll look at which special characters are safe
to use and which are more dangerous, and list them all in
reference tables according to which browsers they can be seen
in. This isn't an exhaustive guide that goes down to the level
of detail of different versions of IE5 on Macs, or even the
many different versions of IE5 for PCs, but it's more thorough
than other reference listings (at the time of publication), and
in most cases will help you decide if you want to risk running
with the symbol or if you need to find some kind of alternative,
for example describing the symbol in words.
Here is a list of the reference tables that follow:
Common symbols (suitable for most browsers)
Currency symbols (suitable for most browsers)
Less common (but still suitable for most browsers)
Latin and other European language symbols (suitable for most browsers)
Not suitable for Netscape 4 (but should work in IE5 and above)
Greek and related mathematical (not suitable for N4)
May not work on a Mac
For IE6 and Netscape 6
Only suitable for fully HTML 4 compliant browsers (such as N6)
Don't seem to work in any browser (curious!)
The version of Netscape Navigator under test was 4.7, and the
Mac was running IE5. IE4 wasn't tested.
But first a few words about special character notations.
Entities
The formal name for a special character is a character entity,
and it can be written in two ways in HTML. The easiest of the
two is called the symbolic reference. All symbolic
references start with an ampersand and end with a semi-colon.
Between these is a description of the symbol, and it's generally
a shortened version of the full expression, so we get •
for a bullet point, and ¸ for a standalone cedilla. The
letters in the middle are case sensitive, and are usually lower
case, though there are exceptions.
The second way is called the numeric reference. Numeric
references also start with an ampersand and finish with a
semicolon, but between them is a number preceded by a hash.
Under this system a bullet point is • and a standalone
cedilla is ¸. These are less memorable than symbolic
references, but they correspond to just a single byte of data,
so they can be useful if you are trying to optimise your pages
for minimum download time.
Symbolic references are also sometimes referred to as entity
references, and numeric references may also be called decimal
references.
You can find a full explanation of HTML 4 character entity
references, with all the relevant ISO numbers and other
organisational stuff,
here at the W3C site.
It's worth noting the pattern in the way symbolic references
are formed. Once you're familiar with the pattern, you may be
able to guess the correct code for a symbol instead of having
to look it up.
Contents:
Common Symbols
Currency
Less Common
Latin and other European Languages
Not Suitable for Netscape 4
Greek and Related Mathematical
May Not Work on a Mac
For IE6 and Netscape 6
Only Suitable for Fully HTML 4 Compliant Browsers
Don't Seem to Work in Any Browser
Common Symbols
|