Project file contains UTF-8 BOM can't processesed by qmake and will
cause subtle errors.
Task-number: QTBUG-25848
Change-Id: Id69ed38c6be63a29fa3792a631cb8cb0ac176148
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
parser.from_file = true;
parser.file = filename;
parser.line_no = 0;
- QTextStream t(&qfile);
- ret = read(t, place);
+ if (qfile.peek(3) == QByteArray("\xef\xbb\xbf")) {
+ //UTF-8 BOM will cause subtle errors
+ qmake_error_msg("Unexpected UTF-8 BOM found");
+ ret = false;
+ } else {
+ QTextStream t(&qfile);
+ ret = read(t, place);
+ }
if(!using_stdin)
qfile.close();
}