diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-04 09:58:02 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-04 09:58:02 (GMT) |
commit | 953ff11a1b424dd288b6504c5a6f918acaebaa60 (patch) | |
tree | 76156b65635731028ad8b15a469223d7bcc703c8 | |
parent | 81cddcd59c51fb3b5f933eec0ae73ff9038d90d9 (diff) | |
parent | 15a7626480b64d85992bed819fe6052e0c5c8fa9 (diff) | |
download | Qt-953ff11a1b424dd288b6504c5a6f918acaebaa60.zip Qt-953ff11a1b424dd288b6504c5a6f918acaebaa60.tar.gz Qt-953ff11a1b424dd288b6504c5a6f918acaebaa60.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Make qmake to pass all UTF-8 characters unchanged through parser.
-rw-r--r-- | qmake/project.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 7351d1a..5f5745a 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -677,7 +677,23 @@ QMakeProject::reset() bool QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int numLines) { - QString s = t.simplified(); + // To preserve the integrity of any UTF-8 characters in .pro file, temporarily replace the + // non-breaking space (0xA0) characters with another non-space character, so that + // QString::simplified() call will not replace it with space. + // Note: There won't be any two byte characters in .pro files, so 0x10A0 should be a safe + // replacement character. + static QChar nbsp(0xA0); + static QChar nbspFix(0x01A0); + QString s; + if (t.indexOf(nbsp) != -1) { + s = t; + s.replace(nbsp, nbspFix); + s = s.simplified(); + s.replace(nbspFix, nbsp); + } else { + s = t.simplified(); + } + int hash_mark = s.indexOf("#"); if(hash_mark != -1) //good bye comments s = s.left(hash_mark); |