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

Provide an overload for QTextStream::setEncoding() that accepts an arbitrary encoding name

    XMLWordPrintable

Details

    Description

      Qt 6.4 enabled QStringEncoder/QStringDecoder to use all codecs provided by ICU (see https://doc.qt.io/qt-6/whatsnew64.html#qt-core-module ). However, as of Qt 6.6, QTextStream::setEncoding() only accepts the few encodings covered by QStringConverter::Encoding.

      Adding a QTextStream::setEncoding(const char*) overload to match the QStringEncoder/QStringDecoder constructors will make it a more complete replacement for Qt 5's QTextStream::setCodec().

       

      Use case

      Without this overload, users porting from Qt 5 might need to significantly restructure their code. For example, instead of passing encoded data straight into QTextStream, they must manually pass it into to QStringDecoder first, and then pass the decoded string to QTextStream.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes