Does Qt 6 only support a few common text encodings?

61 Views Asked by At

Qt 6 introduced the QStringConverter class as a replacement for the Qt 5 QTextCodec class. QTextCodec is deprecated in Qt 6 and only available as part of the core5compat compatibility module. QTextCodec will probably be removed in Qt 7.

Now, QTextCodec supported a whole lot of different text encodings (see here), but QStringConverter only supports the most common Unicode text encodings and ISO-8859-1 (see here). However, legacy text encodings like e.g. CP-1252 are still needed today to decode text files from the pre-Unicode era.

So, how can I continue to use any of these text encodings in Qt 6? Is the Qt 5 compatibility module really the only way?

0

There are 0 best solutions below