summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-14 05:05:18 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-14 05:05:18 (GMT)
commit176698a91d3b2256a093785967c6706328981af4 (patch)
tree8c94a018b4e12a81b1b9ee4ae2e5853010435606 /src
parent513cc4be0bec4a5fb303062ecbecf87708dc0e9b (diff)
downloadQt-176698a91d3b2256a093785967c6706328981af4.zip
Qt-176698a91d3b2256a093785967c6706328981af4.tar.gz
Qt-176698a91d3b2256a093785967c6706328981af4.tar.bz2
Force QML files to be always UTF-8.
Ensure test works in all locales.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmlerror.cpp1
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlerror.cpp b/src/declarative/qml/qmlerror.cpp
index 5ee9144..514fe44 100644
--- a/src/declarative/qml/qmlerror.cpp
+++ b/src/declarative/qml/qmlerror.cpp
@@ -201,6 +201,7 @@ QDebug operator<<(QDebug debug, const QmlError &error)
if (f.open(QIODevice::ReadOnly)) {
QByteArray data = f.readAll();
QTextStream stream(data, QIODevice::ReadOnly);
+ stream.setCodec("UTF-8");
const QString code = stream.readAll();
const QStringList lines = code.split(QLatin1Char('\n'));
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 9cc12b3..6e5f315 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -870,6 +870,7 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
const QString fileName = url.toString();
QTextStream stream(qmldata, QIODevice::ReadOnly);
+ stream.setCodec("UTF-8");
const QString code = stream.readAll();
data = new QmlScriptParserJsASTData(fileName);