Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33643

QXmlStreamReader/Writer process the apostrophe char differently.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 4.8.5, 4.8.6, 5.1.1, 5.2.0
    • None

    Description

      QXmlStreamReader handles the apostrophe char correctly whether it is escaped or not. On the other hand the QXmlStreamWriter doesn't escape the apostrophe

      main.cpp
      #include <QXmlStreamReader>
      #include <QxmlStreamWriter>
      #include <QtDebug>
      
      int main( int argc, char* argv[] )
      {
          QApplication a(argc, argv);
      
          QByteArray byteArray;
          QXmlStreamWriter writer(&byteArray);
          writer.setAutoFormatting(true);
          writer.writeStartDocument();
          writer.writeTextElement("Apostroph", "'");
          writer.writeEndDocument();
      
          qDebug() << byteArray;
      
          QXmlStreamReader reader(byteArray);
          while (!reader.atEnd()) {
               if (reader.readNextStartElement())
                   qDebug() << reader.readElementText();
           }
          return 0;
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-33643
        # Subject Branch Project Status CR V

        Activity

          People

            sgaist Samuel Gaist
            sgaist Samuel Gaist
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes