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 |
---|---|---|---|
` | \60 | ` | grave |
´ | \B4 | ´ | acute |
˘ | \02D8 | ˘ | breve |
ˇ | \02C7 | ˇ | caron |
¸ | \B8 | ¸ | cedilla |
^ | \5E | ^ | circumflex |
¨ | \A8 | ¨ | dieresis |
˙ | \02D9 | ˙ | dot accent |
˝ | \02DD | ˝ | double acute |
¯ | \AF | ¯ | macron |
˛ | \02DB | ˛ | ogonek |
˚ | \02DA | ˚ | ring |
˜ | \02DC | ˜ | tilde |
Special Space Characters
XML | CSS | Character | Name |
---|---|---|---|
  | \20 | foo bar | space |
  | \a0 | foo bar | no-break space |
  | \2008 | foo bar | punctuation space |
  | \2009 | foo bar | thin space |
  | \200a | foo bar | hair space |
​ | \200b | foobar | zero width space |
  | \202f | foo bar | narrow no-break space |
  | \205f | foo bar | medium mathematical space |
 | \feff | foobar | zero width no-break space |
  | \1680 | foo bar | ogham space mark |
  | \2000 | foo bar | en quad |
  | \2001 | foo bar | em quad |
  | \2002 | foo bar | en space |
  | \2003 | foo bar | em space |
  | \3000 | foo bar | ideographic space |
Miscellaneous
XML | CSS | Character | Name |
---|---|---|---|
… | \2026 | … | ellipsis |
— | \2014 | — | em dash |
– | \2013 | – | en dash |
fi | \FB01 | fi | fi ligature |
fl | \FB02 | fl | fl ligature |
Æ | \C6 | Æ | AE |
æ | \E6 | æ | ae |
Œ | \0152 | Œ | OE |
œ | \0153 | œ | oe |
ß | \DF | ß | sharp s |