Why is Qt losing my thin space unicode character when loading an XML file?

I have an XML document, part of which has the following in it:\[code\]<math display='block'><mtext> </mtext></math>\[/code\]If this is loaded into Qt (specifically the Qt MathML widget where I found this problem), the QDomDocument object loses the unicode thin space character (U+2009). This Python example code demonstrates the problem:\[code\]from PyQt4.QtXml import *d = QDomDocument()d.setContent("<math display='block'><mtext> </mtext></math>")print repr(unicode(d.toString()))\[/code\]The output from this code is:\[code\]u'<math display="block">\n <mtext/>\n</math>\n'\[/code\]Inserting an extra non-space character after the thin space stops the thin space being lost.Is this my mistake, an XML feature, or does Qt have a bug?
 
Back
Top