From c4f1ac0fbcd452f440aee4a3304574cb7fbca0ce Mon Sep 17 00:00:00 2001
From: Mitch Curtis <mitch.curtis@digia.com>
Date: Tue, 12 Mar 2013 15:51:26 +0100
Subject: [PATCH] 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>
---
 src/linguist/linguist/sourcecodeview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
     }
 
-- 
GitLab