Details
-
Bug
-
Resolution: Cannot Reproduce
-
P3: Somewhat important
-
None
-
4.7.1, 5.6.2
-
None
-
I believe this has shown up in Qt 4.7. We did not run into this with earlier versions of Qt, but we could have just been lucky.
-
21
Description
I'm sure this can be argued, but I would expect BOM a common thing with XML and would expect the Qt's XML processing to handle it.
Small Qt App to show the difference in behavior. Attached in xmlBom.zip.
C:\Users\jwild\Dev\Qt\xmlBom\xmlBom.zip
Only 1st string without BOM has it's elements listed. Here is the main
code of the test.
void MainWindow::list() { QString s = "Hello World"; QString xmlWithoutBom = "<body><element>Hello</element></body>"; QString xmlWithBom = "\xef\xbb\xbf<body><element>Hello</element></body>"; QXmlStreamReader xmlReader; s = "Parse without BOM: \n"; xmlReader.addData(xmlWithoutBom); while (!xmlReader.atEnd()) { if (xmlReader.isStartElement()) { s += "Start Elem: " + xmlReader.name().toString() + "\n"; } xmlReader.readNext(); } s += "End Parse without BOM\n\n"; s += "Parse with BOM: \n"; xmlReader.addData(xmlWithBom); while (!xmlReader.atEnd()) { if (xmlReader.isStartElement()) { s += "Start Elem: " + xmlReader.name().toString() + "\n"; } xmlReader.readNext(); } s += "End Parse with BOM\n\n"; textViewer->setPlainText( s ); }