# HG changeset patch # User Chris Cannam # Date 1425316823 0 # Node ID 9876a1db566c30398da9c1d751eadbbbee10d495 # Parent 7b2dd0d4c366057ce25547a4015f3a76981abedc Specify UTF-8 encoding when writing XML formats -- the XML header always indicated UTF-8 but the QTextStream defaulted to local encoding which is generally not UTF-8 on Windows diff -r 7b2dd0d4c366 -r 9876a1db566c framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Mon Sep 29 13:27:13 2014 +0100 +++ b/framework/MainWindowBase.cpp Mon Mar 02 17:20:23 2015 +0000 @@ -90,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -2235,6 +2236,7 @@ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QTextStream out(&bzFile); + out.setCodec(QTextCodec::codecForName("UTF-8")); toXml(out, false); out.flush(); @@ -2280,6 +2282,7 @@ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QTextStream out(&file); + out.setCodec(QTextCodec::codecForName("UTF-8")); toXml(out, true); out.flush();