Skip to content

Commit 973f926

Browse files
committed
Add explanatory comment
1 parent dce1661 commit 973f926

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/cli/TextStream.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ TextStream::TextStream(const QByteArray& array, QIODevice::OpenMode openMode)
6060

6161
void TextStream::write(const char* str)
6262
{
63+
// Workaround for an issue with QTextStream. Its operator<<(const char *string) will encode the
64+
// string with a non-UTF-8 encoding. We work around this by wrapping the input string into
65+
// a QString, thus enforcing UTF-8. More info:
66+
// https://code.qt.io/cgit/qt/qtbase.git/commit?id=cec8cdba4d1b856e17c8743ba8803349d42dc701
6367
*this << QString(str);
6468
}
6569

0 commit comments

Comments
 (0)