CLI: Fix XML encoding when export database

Add write function to TextStream
Fix #3900
This commit is contained in:
Balazs Gyurak authored and Jonathan White committed 2020-01-29 20:51:53 -05:00
1 parent 792c1c94f7
commit 06e0f38523
3 files changed
+12 -1

No files matched your search

+9
View File
@@ -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";