diff --git a/src/data/oziparsers.cpp b/src/data/oziparsers.cpp index cca2f734..164aada6 100644 --- a/src/data/oziparsers.cpp +++ b/src/data/oziparsers.cpp @@ -24,7 +24,8 @@ bool PLTParser::parse(QFile *file, QList &tracks, QByteArray line = file->readLine(); if (_errorLine == 1) { - if (!line.trimmed().startsWith("OziExplorer Track Point File")) { + QString fileType(QString::fromUtf8(line).trimmed()); + if (!fileType.startsWith("OziExplorer Track Point File")) { _errorString = "Not a PLT file"; return false; } @@ -107,7 +108,8 @@ bool RTEParser::parse(QFile *file, QList &tracks, QByteArray line = file->readLine(); if (_errorLine == 1) { - if (!line.trimmed().startsWith("OziExplorer Route File")) { + QString fileType(QString::fromUtf8(line).trimmed()); + if (!fileType.startsWith("OziExplorer Route File")) { _errorString = "Not a RTE file"; return false; } @@ -201,7 +203,8 @@ bool WPTParser::parse(QFile *file, QList &tracks, QByteArray line = file->readLine(); if (_errorLine == 1) { - if (!line.trimmed().startsWith("OziExplorer Waypoint File")) { + QString fileType(QString::fromUtf8(line).trimmed()); + if (!fileType.startsWith("OziExplorer Waypoint File")) { _errorString = "Not a WPT file"; return false; } diff --git a/src/map/mapfile.cpp b/src/map/mapfile.cpp index f73f4d14..581cafea 100644 --- a/src/map/mapfile.cpp +++ b/src/map/mapfile.cpp @@ -26,7 +26,8 @@ int MapFile::parse(QIODevice &device, QList &points, QByteArray line = device.readLine(); if (ln == 1) { - if (!line.trimmed().startsWith("OziExplorer Map Data File")) + QString fileType(QString::fromUtf8(line).trimmed()); + if (!fileType.startsWith("OziExplorer Map Data File")) return ln; } else if (ln == 2) _name = line.trimmed();