~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/openSM2sync/text_formats/xml_format.py

  • Committer: Peter.Bienstman at UGent
  • Date: 2015-01-15 20:17:02 UTC
  • Revision ID: peter.bienstman@ugent.be-20150115201702-5hluqq3qi34cqh2p
Fix export for facts containing control characters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
            else:
104
104
                tags += "<%s>%s</%s>" % (key, saxutils.escape(value), key)
105
105
        xml = "<log%s>%s</log>\n" % (attribs, tags)
 
106
        # Strip control characters.
 
107
        xml = "".join([i for i in xml if 31 < ord(i)])
106
108
        #import sys; sys.stderr.write(xml.encode("utf-8"))
107
109
        return xml
108
110