Character Encoding in an XML Prolog
An XML document always starts with a prolog. The prolog describes the contents of the document including its character encoding. The following prolog contains a mandatory version number and the optional encoding declaration.
<?xml version="1.0" encoding="Shift_JIS "?>
The entire contents of the XML document following the “EncodingDecl” section of the XML prolog must be in the specified character set. This includes everything in the message: URIs, end-of-line characters, whitespace, etc.
For example, in the XML fragment above, all characters following the “?>” must be in the Shift-JIS encoding. For more information on XML Declarations see the XML 1.0 specification at