From 7bf8470d36b8b93cf925e439a79a142d8e2fd82c Mon Sep 17 00:00:00 2001 From: Guy Scharf Date: Mon, 18 Jan 2021 21:55:14 -0700 Subject: [PATCH] Mark exported journal backup file as UTF-8. --- oscar/SleepLib/journal.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oscar/SleepLib/journal.cpp b/oscar/SleepLib/journal.cpp index 56ddff0d..6e515497 100644 --- a/oscar/SleepLib/journal.cpp +++ b/oscar/SleepLib/journal.cpp @@ -214,6 +214,7 @@ void BackupJournal(QString filename) stream.setAutoFormattingIndent(2); stream.writeStartDocument(); +// stream.writeProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\""); stream.writeStartElement("OSCAR"); stream.writeStartElement("Journal"); stream.writeAttribute("username", p_profile->user->userName()); @@ -301,6 +302,8 @@ void BackupJournal(QString filename) } QTextStream ts(&file); + ts.setCodec("UTF-8"); + ts.setGenerateByteOrderMark(true); ts << outBuf; file.close(); }