I have an XML document, part of which has the following in it:
<math display='block'><mtext> </mtext></math>
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:
from PyQt4.QtXml import *
d = QDomDocument()
d.setContent("<math display='block'><mtext> </mtext></math>")
print repr(unicode(d.toString()))
The output from this code is:
u'<math display="block">\n <mtext/>\n</math>\n'
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?