Character Entities
Character entities are a method of including arbitrary characters in XML documents by referencing their UNICODE number rather than writing them directly. CSS has a similar mechanism to include special characters.
This can be convenient when you wish to include characters such as smart quotes, symbols or mathematical operators that do not exist in the character encoding that you are using for your XML documents (such as ASCII or ISO-8859-1 "Latin-1"), or when you want to insert some of these characters into the final layout by means of CSS.
Here is an example of including smart quotes in an XML document using character entities:
XML
<p>
These are “smart quotes” to be precise.
</p>
Output
These are “smart quotes” to be precise.
A typical usecase for character entities in CSS is the -prince-text-replace
property, which replaces a certain character string with another one. In the sample "Reconstructed Essay" (HTML - PDF), the property is used to replace occurrences of "s" with the "long s" to recreate the original printed book.
CSS
body {
-prince-text-replace: "s" "\017F";
}
The tables below are a quick reference for some commonly requested UNICODE characters, expressed in XML and CSS notation; for everything else please consult the UNICODE code charts.
Accented Letters
XML | CSS | Character | Name |
---|---|---|---|
À | \C0 | À | A grave |
Á | \C1 | Á | A acute |
 | \C2 |  | A circumflex |
à | \C3 | à | A tilde |
Ä | \C4 | Ä | A dieresis |
Å | \C5 | Å | A ring |
Ç | \C7 | Ç | C cedilla |
È | \C8 | È | E grave |
É | \C9 | É | E acute |
Ê | \CA | Ê | E circumflex |
Ë | \CB | Ë | E dieresis |
Ì | \CC | Ì | I grave |
Í | \CD | Í | I acute |
Î | \CE | Î | I circumflex |
Ï | \CF | Ï | I dieresis |
Ñ | \D1 | Ñ | N tilde |
Ò | \D2 | Ò | O grave |
Ó | \D3 | Ó | O acute |
Ô | \D4 | Ô | O circumflex |
Õ | \D5 | Õ | O tilde |
Ö | \D6 | Ö | O dieresis |
Ø | \D8 | Ø | O slash |
Ù | \D9 | Ù | U grave |
Ú | \DA | Ú | U acute |
Û | \DB | Û | U circumflex |
Ü | \DC | Ü | U dieresis |
Ÿ | \0178 | Ÿ | Y dieresis |
à | \E0 | à | a grave |
á | \E1 | á | a acute |
â | \E2 | â | a circumflex |
ã | \E3 | ã | a tilde |
ä | \E4 | ä | a dieresis |
å | \E5 | å | a ring |
ç | \E7 | ç | c cedilla |
è | \E8 | è | e grave |
é | \E9 | é | e acute |
ê | \EA | ê | e circumflex |
ë | \EB | ë | e dieresis |
ì | \EC | ì | i grave |
í | \ED | í | i acute |
î | \EE | î | i circumflex |
ï | \EF | ï | i dieresis |
ı | \0131 | ı | dotless i |
ñ | \F1 | ñ | n tilde |
ò | \F2 | ò | o grave |
ó | \F3 | ó | o acute |
ô | \F4 | ô | o circumflex |
õ | \F5 | õ | o tilde |
ö | \F6 | ö | o dieresis |
ø | \F8 | ø | o slash |
ù | \F9 | ù | u grave |
ú | \FA | ú | u acute |
û | \FB | û | u circumflex |
ü | \FC | ü | u dieresis |
ÿ | \FF | ÿ | y dieresis |
Symbols
XML | CSS | Character | Name |
---|---|---|---|
• | \2022 | • | bullet |
¢ | \A2 | ¢ | cent |
© | \A9 | © | copyright |
¤ | \A4 | ¤ | currency |
† | \2020 | † | dagger |
° | \B0 | ° | degree |
÷ | \F7 | ÷ | divide |
‡ | \2021 | ‡ | double dagger |
ƒ | \0192 | ƒ | florin |
⁄ | \2044 | ⁄ | fraction |
¡ | \A1 | ¡ | inverted exclamation |
¿ | \BF | ¿ | inverted question |
µ | \B5 | µ | micro |
· | \B7 | · | middle dot |
¬ | \AC | ¬ | not |
ª | \AA | ª | ordfeminine |
º | \BA | º | ordmasculine |
¶ | \B6 | ¶ | paragraph |
‰ | \2030 | ‰ | perthousand |
± | \B1 | ± | plusminus |
® | \AE | ® | registered |
§ | \A7 | § | section |
£ | \A3 | £ | sterling |
™ | \2122 | ™ | trademark |
¥ | \A5 | ¥ | yen |
Quotes
XML | CSS | Character | Name |
---|---|---|---|
‘ | \2018 | ‘ | left single quote |
’ | \2019 | ’ | right single quote |
“ | \201C | “ | left double quote |
” | \201D | ” | right double quote |
‹ | \2039 | ‹ | left single guillemet |
› | \203A | › | right single guillemet |
« | \AB | « | left double guillemet |
» | \BB | » | right double guillemet |
‚ | \201A | ‚ | base single quote |
„ | \201E | „ | base double quote |
Accents
XML | CSS | Character | Name |
---|---|---|---|
` | \x60 | ` | grave |
´ | \xB4 | ´ | acute |
˘ | \x02D8 | ˘ | breve |
ˇ | \x02C7 | ˇ | caron |
¸ | \xB8 | ¸ | cedilla |
^ | \x5E | ^ | circumflex |
¨ | \xA8 | ¨ | dieresis |
˙ | \x02D9 | ˙ | dot accent |
˝ | \x02DD | ˝ | double acute |
¯ | \xAF | ¯ | macron |
˛ | \x02DB | ˛ | ogonek |
˚ | \x02DA | ˚ | ring |
˜ | \x02DC | ˜ | tilde |
Special Space Characters
XML | CSS | Character | Name |
---|---|---|---|
  | \x20 | foo bar | space |
  | \xa0 | foo bar | no-break space |
  | \x2008 | foo bar | punctuation space |
  | \x2009 | foo bar | thin space |
  | \x200a | foo bar | hair space |
​ | \x200b | foobar | zero width space |
  | \x202f | foo bar | narrow no-break space |
  | \x205f | foo bar | medium mathematical space |
 | \xfeff | foobar | zero width no-break space |
  | \x1680 | foo bar | ogham space mark |
  | \x2000 | foo bar | en quad |
  | \x2001 | foo bar | em quad |
  | \x2002 | foo bar | en space |
  | \x2003 | foo bar | em space |
  | \x3000 | foo bar | ideographic space |
Miscellaneous
XML | CSS | Character | Name |
---|---|---|---|
… | \x2026 | … | ellipsis |
— | \x2014 | — | em dash |
– | \x2013 | – | en dash |
fi | \xFB01 | fi | fi ligature |
fl | \xFB02 | fl | fl ligature |
Æ | \xC6 | Æ | AE |
æ | \xE6 | æ | ae |
Œ | \x0152 | Œ | OE |
œ | \x0153 | œ | oe |
ß | \xDF | ß | sharp s |