Mark exported journal backup file as UTF-8.

This commit is contained in:
Guy Scharf 2021-01-18 21:55:14 -07:00
parent a06d37e10e
commit 7bf8470d36

View File

@ -214,6 +214,7 @@ void BackupJournal(QString filename)
stream.setAutoFormattingIndent(2); stream.setAutoFormattingIndent(2);
stream.writeStartDocument(); stream.writeStartDocument();
// stream.writeProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
stream.writeStartElement("OSCAR"); stream.writeStartElement("OSCAR");
stream.writeStartElement("Journal"); stream.writeStartElement("Journal");
stream.writeAttribute("username", p_profile->user->userName()); stream.writeAttribute("username", p_profile->user->userName());
@ -301,6 +302,8 @@ void BackupJournal(QString filename)
} }
QTextStream ts(&file); QTextStream ts(&file);
ts.setCodec("UTF-8");
ts.setGenerateByteOrderMark(true);
ts << outBuf; ts << outBuf;
file.close(); file.close();
} }