This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ngrig
Recipients
Date 2006-04-14.20:21:23
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This is a patch to bug #1470540. It enables
xml.sax.saxutils.XMLGenerator to work correctly with
UTF-16 (and other encodings not derived from US-ASCII).
The proposed changes are as follows:

- in XMLGenerator.__init__(), create a StreamWriter
instead of a plain stream;

- in XMLGenerator._write(), convert everything to
Unicode before writing;

- in XMLGenerator.endDocument(), flush the StreamWriter.

The patch is applicable to xml/sax/saxutils.py in the
stable release (2.4.3), as well as to
xmlcore/sax/saxutils.py in the current release (2.5).

The smoke test is attached to the bug description in
the Bug Manager.

Regards,
Nikolai Grigoriev
History
Date User Action Args
2007-08-23 15:48:15adminlinkissue1470548 messages
2007-08-23 15:48:15admincreate