Name

Encoding Declaration

Synopsis

                        ... encoding="
                        encoding-name
                        " ...

The encoding declaration, if present, indicates which character-encoding was used to store the document. Although all XML documents are ultimately handled as Unicode by the parser, the external storage scheme may be anything from an ASCII text file using the Latin-1 character set (ISO-8859-1) to a file with native Japanese characters.

XML parsers may also recognize other encodings, but the XML specification only requires that they recognize UTF-8 and UTF-16 encoded documents. Most parsers also support additional character encodings. For a thorough discussion of character-encoding schemes, see Chapter 27.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.