Decode text stream from QML files as UTF-8 even when the latter
is not the default system encoding (QML supports UTF-8 only).
Change-Id: I32ccf88e93182ffa78345235217258761e95195a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
return false;
}
- QString code = QTextStream(&file).readAll();
+ QString code;
+ if (!qmlMode) {
+ code = QTextStream(&file).readAll();
+ } else {
+ QTextStream ts(&file);
+ ts.setCodec("UTF-8");
+ ts.setAutoDetectUnicode(true);
+ code = ts.readAll();
+ }
if (! qmlMode) {
// fetch the optional pragma directives for Javascript files.