mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
413 B
C++
21 lines
413 B
C++
2 years ago
|
#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
|