[issue18911] minidom does not encode correctly when calling Document.writexml

Windson Yang report at bugs.python.org
Wed May 15 23:12:19 EDT 2019


Windson Yang <wiwindson at outlook.com> added the comment:

I added a PR for like this:

   .. note::

      You should specify the "xmlcharrefreplace" error handler when open a file with
      specified encoding::

         writer = open(
                filename, "w", encoding="utf-8",
                errors="xmlcharrefreplace")
         doc.writexml(writer, "", "  ", "utf-8")

----------
nosy: +Windson Yang

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue18911>
_______________________________________


More information about the Python-bugs-list mailing list