Skip to main content

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 &#x201C;smart quotes&#x201D; 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.

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

XMLCSSCharacterName
&#xC0;\C0ÀA grave
&#xC1;\C1ÁA acute
&#xC2;\C2ÂA circumflex
&#xC3;\C3ÃA tilde
&#xC4;\C4ÄA dieresis
&#xC5;\C5ÅA ring
&#xC7;\C7ÇC cedilla
&#xC8;\C8ÈE grave
&#xC9;\C9ÉE acute
&#xCA;\CAÊE circumflex
&#xCB;\CBËE dieresis
&#xCC;\CCÌI grave
&#xCD;\CDÍI acute
&#xCE;\CEÎI circumflex
&#xCF;\CFÏI dieresis
&#xD1;\D1ÑN tilde
&#xD2;\D2ÒO grave
&#xD3;\D3ÓO acute
&#xD4;\D4ÔO circumflex
&#xD5;\D5ÕO tilde
&#xD6;\D6ÖO dieresis
&#xD8;\D8ØO slash
&#xD9;\D9ÙU grave
&#xDA;\DAÚU acute
&#xDB;\DBÛU circumflex
&#xDC;\DCÜU dieresis
&#x0178;\0178ŸY dieresis
&#xE0;\E0àa grave
&#xE1;\E1áa acute
&#xE2;\E2âa circumflex
&#xE3;\E3ãa tilde
&#xE4;\E4äa dieresis
&#xE5;\E5åa ring
&#xE7;\E7çc cedilla
&#xE8;\E8èe grave
&#xE9;\E9ée acute
&#xEA;\EAêe circumflex
&#xEB;\EBëe dieresis
&#xEC;\ECìi grave
&#xED;\EDíi acute
&#xEE;\EEîi circumflex
&#xEF;\EFïi dieresis
&#x0131;\0131ıdotless i
&#xF1;\F1ñn tilde
&#xF2;\F2òo grave
&#xF3;\F3óo acute
&#xF4;\F4ôo circumflex
&#xF5;\F5õo tilde
&#xF6;\F6öo dieresis
&#xF8;\F8øo slash
&#xF9;\F9ùu grave
&#xFA;\FAúu acute
&#xFB;\FBûu circumflex
&#xFC;\FCüu dieresis
&#xFF;\FFÿy dieresis

Symbols

XMLCSSCharacterName
&#x2022;\2022bullet
&#xA2;\A2¢cent
&#xA9;\A9©copyright
&#xA4;\A4¤currency
&#x2020;\2020dagger
&#xB0;\B0°degree
&#xF7;\F7÷divide
&#x2021;\2021double dagger
&#x0192;\0192ƒflorin
&#x2044;\2044fraction
&#xA1;\A1¡inverted exclamation
&#xBF;\BF¿inverted question
&#xB5;\B5µmicro
&#xB7;\B7·middle dot
&#xAC;\AC¬not
&#xAA;\AAªordfeminine
&#xBA;\BAºordmasculine
&#xB6;\B6paragraph
&#x2030;\2030perthousand
&#xB1;\B1±plusminus
&#xAE;\AE®registered
&#xA7;\A7§section
&#xA3;\A3£sterling
&#x2122;\2122trademark
&#xA5;\A5¥yen

Quotes

XMLCSSCharacterName
&#x2018;\2018left single quote
&#x2019;\2019right single quote
&#x201C;\201Cleft double quote
&#x201D;\201Dright double quote
&#x2039;\2039left single guillemet
&#x203A;\203Aright single guillemet
&#xAB;\AB«left double guillemet
&#xBB;\BB»right double guillemet
&#x201A;\201Abase single quote
&#x201E;\201Ebase double quote

Accents

XMLCSSCharacterName
&#x60;\60`grave
&#xB4;\B4´acute
&#x02D8;\02D8˘breve
&#x02C7;\02C7ˇcaron
&#xB8;\B8¸cedilla
&#x5E;\5E^circumflex
&#xA8;\A8¨dieresis
&#x02D9;\02D9˙dot accent
&#x02DD;\02DD˝double acute
&#xAF;\AF¯macron
&#x02DB;\02DB˛ogonek
&#x02DA;\02DA˚ring
&#x02DC;\02DC˜tilde

Special Space Characters

XMLCSSCharacterName
&#x20;\20foo barspace
&#xa0;\a0foo barno-break space
&#x2008;\2008foobarpunctuation space
&#x2009;\2009foobarthin space
&#x200a;\200afoobarhair space
&#x200b;\200bfoobarzero width space
&#x202f;\202ffoobarnarrow no-break space
&#x205f;\205ffoobarmedium mathematical space
&#xfeff;\fefffoobarzero width no-break space
&#x1680;\1680foobarogham space mark
&#x2000;\2000foo baren quad
&#x2001;\2001foobarem quad
&#x2002;\2002foobaren space
&#x2003;\2003foobarem space
&#x3000;\3000foo barideographic space

Miscellaneous

XMLCSSCharacterName
&#x2026;\2026ellipsis
&#x2014;\2014em dash
&#x2013;\2013en dash
&#xFB01;\FB01fi ligature
&#xFB02;\FB02fl ligature
&#xC6;\C6ÆAE
&#xE6;\E6æae
&#x0152;\0152ŒOE
&#x0153;\0153œoe
&#xDF;\DFßsharp s