15 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
16 #include <QStringDecoder>
17 #include <QStringEncoder>
27 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
30 QTextCodec
const & codec() {
31 static auto const *
const codec =
32 QTextCodec::codecForName(QByteArrayLiteral(
"Windows-1252"));
41 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
42 return codec().toUnicode(data);
44 QStringDecoder decoder(
"Windows-1252", QStringDecoder::Flag::Stateless);
46 QString result = decoder(data);
53 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
54 return codec().fromUnicode(str);
56 QStringEncoder encoder(
"Windows-1252", QStringEncoder::Flag::Stateless);
58 QByteArray result = encoder(str);
QString toUnicode(QByteArray const &data)
QByteArray fromUnicode(QString const &str)