1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 19:59:55 +00:00
openmw/components/misc/utf8qtextstream.hpp
2023-01-12 15:39:50 +04:00

20 lines
413 B
C++

#ifndef MISC_UTF8QTEXTSTREAM_HPP
#define MISC_UTF8QTEXTSTREAM_HPP
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QTextCodec>
#endif
#include <QTextStream>
namespace
{
void ensureUtf8Encoding(QTextStream& stream)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
stream.setCodec(QTextCodec::codecForName("UTF-8"));
#else
stream.setEncoding(QStringConverter::Utf8);
#endif
}
}
#endif