Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
4.8.2, 5.0.1
-
None
-
Qt 5: c4f1ac0fbcd452f440aee4a3304574cb7fbca0ce Qt 4.8: 6626e5f41712723405c110a4f11ad650116f7523
Description
The Linguist source code viewer does not respect the encoding of the file as it always loads it as latin1.
tools/linguist/linguist/sourcecodeview.cpp:
fileText = QString::fromLatin1(file.readAll());
Steps to reproduce:
The sourcefile is saved in UTF-8 and some unicode character is used, for example:
setText(tr("variable χ"));
Create translation file:
lupdate example.pro -codecfortr UTF-8 -ts example.ts
Open the file in Linguist
linguist example.ts
Result: Unicode character is not shown correctly