diff options
Diffstat (limited to 'src/cli/TextStream.cpp')
-rw-r--r-- | src/cli/TextStream.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cli/TextStream.cpp b/src/cli/TextStream.cpp index 938fd6292..5757f90e9 100644 --- a/src/cli/TextStream.cpp +++ b/src/cli/TextStream.cpp @@ -58,6 +58,15 @@ TextStream::TextStream(const QByteArray& array, QIODevice::OpenMode openMode) detectCodec(); } +void TextStream::write(const char* str) +{ + // Workaround for an issue with QTextStream. Its operator<<(const char *string) will encode the + // string with a non-UTF-8 encoding. We work around this by wrapping the input string into + // a QString, thus enforcing UTF-8. More info: + // https://code.qt.io/cgit/qt/qtbase.git/commit?id=cec8cdba4d1b856e17c8743ba8803349d42dc701 + *this << QString(str); +} + void TextStream::detectCodec() { QString codecName = "UTF-8"; |