Commit a4cbd970 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Changed license template reading to use the global default encoding.

Task-number: QTCREATORBUG-3039

Reviewed-by: con
parent 79d6e943
......@@ -45,6 +45,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDate>
#include <QtCore/QLocale>
#include <QtCore/QTextCodec>
#include <QtCore/QTextStream>
#include <QtGui/QFileDialog>
......@@ -208,7 +209,13 @@ QString CppFileSettings::licenseTemplate(const QString &fileName, const QString
qWarning("Unable to open the license template %s: %s", qPrintable(path), qPrintable(file.errorString()));
return QString();
QString license = QString::fromUtf8(file.readAll());
QTextCodec *codec = Core::EditorManager::instance()->defaultTextEncoding();
QTextStream licenseStream(&file);
QString license = licenseStream.readAll();
parseLicenseTemplatePlaceholders(&license, fileName, className);
// Ensure exactly one additional new line separating stuff
const QChar newLine = QLatin1Char('\n');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment