Markup languages also place restrictions on where character references can occur.
==Compatibility issues==
In the initial versions of [[SGML]] and [[HTML]], numeric character references were interpreted in relationship to the document character encoding, rather than [[Unicode]]. For Latin-script documents, numeric character references to characters between x80 and x9F in those documents will not be correct against [[Unicode]], and must be recoded. HTML standards prior to [[HTML 4]] only supported Western Latin script documents: the treatment of character references above #7F may vary between applications and national conventions.
For example, as mentioned above, the correct numeric character reference for the [[Euro sign]] "€" <code>U+20AC</code> when using [[Unicode]] is decimal <code>&#8364;</code> and hexadecimal <code>&#x20AC;</code>. However, if using tools supporting obsolete implementations of HTML, the reference <code>&#128;</code> (Euro in [[Cp1252]] code page) or <code>&#164;</code> (Euro in [[ISO/IEC 8859-15]] ) may work.
As another example, if some text was created originally [[MacRoman]] character set, the [[quotation mark glyphs|left double quotation mark]] {{not a typo|“}} will be represented with codepoint xD2. This will not display properly in a system expecting a document encoded as UTF-8, ISO 8859-1, or [[CP1252]], where this code point is occupied by the letter [[Ò]]. The correct numeric character reference for {{not a typo|“}} in HTML 4 and newer is <code>&#x201C;</code>, because [[Unicode#Upluslink|U+]]201C is its UCS code. In some systems, the [[List of XML and HTML character entity references|named character reference]] <code>&ldquo;</code> may also be available.