summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2013-03-12 15:51:26 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-17 08:20:02 +0200
commitc4f1ac0fbcd452f440aee4a3304574cb7fbca0ce (patch)
treeea505b185ced9603b6f064e019136f8d7fb46438
parent795d35c2dc74d499af37b1dfd46a98c98e4c2f45 (diff)
downloadqttools-c4f1ac0fbcd452f440aee4a3304574cb7fbca0ce.tar.gz
Make linguist's source viewer read all files as UTF-8.
It currently loads source files as latin1, which means unicode characters are not supported. 4944ea0586 removes -codecfortr and hence the ability to specify an encoding. lupdate will then treat all code as UTF-8, so this patch does that too. Task-number: QTBUG-27238 Change-Id: Iefed45de5b4925fee267834a5ed93457fc45b700 Reviewed-by: Debao Zhang <hello@debao.me> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--src/linguist/linguist/sourcecodeview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linguist/linguist/sourcecodeview.cpp b/src/linguist/linguist/sourcecodeview.cpp
index aead2076e..a5cf23f1d 100644
--- a/src/linguist/linguist/sourcecodeview.cpp
+++ b/src/linguist/linguist/sourcecodeview.cpp
@@ -108,7 +108,7 @@ void SourceCodeView::showSourceCode(const QString &absFileName, const int lineNu
appendHtml(tr("<i>File %1 not readable</i>").arg(absFileName));
return;
}
- fileText = QString::fromLatin1(file.readAll());
+ fileText = QString::fromUtf8(file.readAll());
fileHash.insert(absFileName, fileText);
}