296
Annexes
Character coding
Each XML text entity must declare the character-encoding scheme that it uses internally. External parsed entities in an XML document may use different encoding
schemes for their characters than used in the root document. All XML processors
must accept the UTF-8 and UTF-16 encoding of ISO/IEC 10646 as aminimum.
Parsed entities, which are stored in an encoding other than UTF-8 or UTF-16 must
begin with an encoding declaration in the document entity:

According to the XML recommendation the following values are allowed:
• For ISO/IEC 10646 and UNI CODE based encoding "UTF-8", "UTF-16", "ISO10646-UCS-2" and "ISO-10646-UCS-4" shall be used. If an XML text entity is
encoded in UCS-2, it must start with an appropriate encoding signature, the Byte
Order Mark, which is the character with hexadecimal value FEFF.
• For ISO/IEC 8859: "ISO-8859-1 ", "ISO-8859-2", ... , "ISO-8859-1O" can be used.
• For various encodings of JIS X-0208-1997: "ISO-2022-JP", "Shift JIS" and
"EUC-JP" can be used.
This is restricted to "UTF-8", "UTF-16", "ISO-10646-UCS-2" and "ISO-10646UCS-4" in this International Standard.
Alternatively one can reference any character in ISO/IEC 10646 by quoting its
character number in a character reference regardless of which encoding scheme used.
Or one can declare a text entity that represents the character in question. There are
two ways of referring to characters directly, by decimal representation or by hexadecimal reference. The hexadecimal reference for the less-than-sign "<" is:
<
And the decimal representation of the same sign is:
<
XML document header
All XML documents must start with a processing instruction that specifies that
this is an XML document and which version of the XML standard is used. Information about the character encoding, if it is not "UTF-8" or "UTF-16", shall be included in the header also. An example is as follows:
.
The next element shall be the document type declaration element:
Précédent

- 304/331

Suivant