# HG changeset patch # User Andre Heinecke # Date 1475152908 -7200 # Node ID 3438f5cce8ccb25895a2b6555d79bfadf77f0d18 # Parent dab9c19252bd053d129ba0f6bd643ae5a7a51be1 Force text codec for html to use UTF-8 diff -r dab9c19252bd -r 3438f5cce8cc src/converter.cpp --- a/src/converter.cpp Thu Sep 29 14:40:06 2016 +0200 +++ b/src/converter.cpp Thu Sep 29 14:41:48 2016 +0200 @@ -161,6 +161,7 @@ QTextDocument doc; QString htmlString; QTextStream html (&htmlString); + html.setCodec("UTF-8"); ConditionalFormatting bars; @@ -180,8 +181,8 @@ xlsx.setColumnHidden(26, true); int row = 1; - html << "" - ""; + html << "" + "
"; html << QStringLiteral("").arg(HTML_COL1_PERCENT); html << QStringLiteral("").arg(HTML_COL2_PERCENT); html << QStringLiteral("").arg(HTML_COL3_PERCENT); @@ -286,7 +287,7 @@ cursor = choiceMatch.capturedEnd(); /* Alternative answer that is just a list of strings */ unescapeString(choice); - qDebug() << "Caputured unfilled choice: " << choice; + qDebug() << "Captured unfilled choice: " << choice; html << mChoiceTextStyle.arg(choice.toHtmlEscaped()); makeBar(html, 0, doc); xlsx.write(row, 2, QVariant()); @@ -400,6 +401,7 @@ const QString fName = output->fileName().toLower(); if (fName.endsWith(".html")) { QTextStream outstream(output); + outstream.setCodec("UTF-8"); outstream << htmlString; output->close(); } else if (fName.endsWith(".pdf")) {