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

QXmlStreamWriter does not write encoding when destination is a QString

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.6.3
    • None

    Description

      The following piece of code:

      bool fileWritten = false;
      QString dataBuffer;
      QXmlStreamWriter streamWriter(&dataBuffer);
      streamWriter.setCodec("ISO-8859-1");
      streamWriter.setAutoFormatting(true);
      
      streamWriter.writeStartDocument();
      fileWritten = this->write(streamWriter);
      streamWriter.writeEndDocument();
      

      generates a QString with a startDocument that does not contain the encoding. Replacing the QString by anything else (QFile, QBuffer, QByteArray) works well. But as these classes are full of memory leaks they cannot be used safely in a critical commercial product.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            alakauf Alain Kaufmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes