Details
-
Suggestion
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
None
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
- duplicates
-
QTBUG-117362 It would be nice if we bring back QTextStream.setCodec() in Qt6
- Open
- relates to
-
QTBUG-120023 [Doc] Provide guidance on how to port code that uses QTextStream::setCodec() to Qt 6
- Reported