Re: Unicode XML

Jeremy Kloth <[email protected]>
Newsgroups gmane.comp.python.xml
Organization Fourthought, Inc.
Message-ID <[email protected]>
On Wednesday 02 November 2005 1:06 pm, Desilets, Alain wrote:
> I have an application which uses a WDDXMarshaller (the marshaller
> variable below), to encode a dictionary (the mess_argvals variable) as
> an XML string, as follows:
>
> marshaller.dumps(mess_argvals)
>
>
> My problem is that the dictionary mess_argvals may contain some values
> which are strings with unicode characters in them. 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. In
> other words, how do I tell it to generate XML that starts with this
> line:
>
> <?xml version="1.0" encoding="UTF-8" ?>

These two XML declarations are equivalent.  The default encoding for XML is 
UTF-8.

Is your problem that you are getting an exception in the dumps() call?

-- 
Jeremy Kloth
Fourthought, Inc.
http://fourthought.com/
http://4suite.org/
_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.