diff options
author | John Fultz <jfultz@wolfram.com> | 2023-07-15 21:24:54 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2023-07-16 09:02:22 -0500 |
commit | e588b3c3a1052dfc063c9c058d361347329e7899 (patch) | |
tree | f2b4df04526b071e7cada64c9e14e66ebb07dd3b /makeminidawg | |
parent | 97b2ebe1b0d2bafb9d870bc9422ee721e08a6657 (diff) |
Make UTF8-encoding of QTextStream work in Qt5 and 6.
QTextStream::setCodec() is no longer a thing in Qt6. Most of
our call are to set the codec to UTF-8, which happens to be the
default encoding in Qt6. So make a macro so this can compile
in both Qt5 and Qt6.
Diffstat (limited to 'makeminidawg')
-rw-r--r-- | makeminidawg/makeminidawgmain.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/makeminidawg/makeminidawgmain.cpp b/makeminidawg/makeminidawgmain.cpp index ade6c89..2096899 100644 --- a/makeminidawg/makeminidawgmain.cpp +++ b/makeminidawg/makeminidawgmain.cpp @@ -60,7 +60,7 @@ int main(int argc, char **argv) } QTextStream smallerStream(&smallerDict); - smallerStream.setCodec(QTextCodec::codecForName("UTF-8")); + SET_QTEXTSTREAM_TO_UTF8(smallerStream); while (!smallerStream.atEnd()) { @@ -85,7 +85,7 @@ int main(int argc, char **argv) } QTextStream playabilityStream(&playability); - playabilityStream.setCodec(QTextCodec::codecForName("UTF-8")); + SET_QTEXTSTREAM_TO_UTF8(playabilityStream); while (!playabilityStream.atEnd()) { @@ -112,7 +112,7 @@ int main(int argc, char **argv) } QTextStream stream(&file); - stream.setCodec(QTextCodec::codecForName("UTF-8")); + SET_QTEXTSTREAM_TO_UTF8(stream); while (!stream.atEnd()) { |