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

[Doc] Provide guidance on how to port code that uses QTextStream::setCodec() to Qt 6




      QTextStream::setCodec() was removed from Qt 6. However,

      • There is no direct replacement for this function yet (QTBUG-120020 aims to rectify that). The new QStringConverter::Encoding covers very few encodings compared to QTextCodec.
      • The removal of this function is not discussed in https://doc.qt.io/qt-6/qtcore-changes-qt6.html
      • This function and QTextCodec were not deprecated in Qt 5.15


      This is quite a major change but with minimal warning or guidance. https://doc.qt.io/qt-6/qtcore-changes-qt6.html should be updated to point users in the right direction.


      Important points
      If users need to support encodings that are not covered by QStringConverter::Encoding...

      • ...and if QTBUG-120020 is not implemented, then they need guidance on how to restructure their code.
      • ...and if they're on a platform where the pre-built Qt does not have ICU support enabled (e.g. Windows), they need to to know to build Qt from source to enable ICU support (and ship ICU libraries with their software). This is only briefly alluded to at https://doc.qt.io/qt-6/qstringconverter.html#encodingForName


        Issue Links

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



              thiago Thiago Macieira
              skoh-qt Sze Howe Koh
              0 Vote for this issue
              2 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes