[XML-SIG] Unicode XML

Stephane Bortzmeyer stephane at sources.org
Wed Nov 2 22:25:09 CET 2005

On Wed, Nov 02, 2005 at 03:06:05PM -0500,
 Desilets, Alain <Alain.Desilets at nrc-cnrc.gc.ca> wrote 
 a message of 22 lines which said:

> But unfortunately,
> dumps() generates XML code that uses the default encoding, i.e. the XML
> string starts with:
> <?xml version="1.0" ?>
> How can I make dumps() generate XML that uses the UTF-8 encoding. 

Why? UTF-8 is the default, it seems. 


2.8 Prolog and Document Type Declaration

In the absence of information provided by an external transport
protocol (e.g. HTTP or MIME), it is a fatal error for an entity
including an encoding declaration to be presented to the XML processor
in an encoding other than that named in the declaration, or for an
entity which begins with neither a Byte Order Mark nor an encoding
declaration to use an encoding other than UTF-8. Note that since ASCII
is a subset of UTF-8, ordinary ASCII entities do not strictly need an
encoding declaration.

More information about the XML-SIG mailing list