For example, to put a pound (or hash) sign # in an XML file, you can use either of the following:
ASCII decimal and Hex values in XML
<pre> # or # </pre>
23 in hex = 2×16+3 = 35 in decimal
So the syntax is the ampersand and the hash tag followed by the number, then followed by a semicolon.
If doing hex, add the letter “x” before the number.
One more example, a Carriage Return/Line Feed:
You can find an example ASCII character chart here.
How to encode other characters, such as ampersand, a double or single quote
Other common shortcuts (called entity references) are:
& ampersand sign
< less than sign
> greater than sign
" for a double quote
' for a single quote (apostrophe)
CDATA turns off parsing
For long strings where you want to turn off the parser temporarily (in order to allow special characters): '
Other common shortcuts are:
<![CDATA[ anything goes here, such as &, <, > and so on ]]>
Copy and paste from here:
and replace the inner brackets with your CDATA text.
Trademark and Copyright Symbols
Other common symbols are:
Registered Trademark: ® and Copyright: ©