diff --git a/autotests/testedid.cpp b/autotests/testedid.cpp --- a/autotests/testedid.cpp +++ b/autotests/testedid.cpp @@ -121,7 +121,7 @@ << QStringLiteral("SHP") << QStringList({QStringLiteral("SHP"), QStringLiteral("Sharp Corporation")}) << QStringLiteral("") - << QStringLiteral("RXN49\uFFFDLQ133Z1") + << QStringLiteral("RXN49-LQ133Z1") << QStringLiteral("3627c3534e4c82871967b57237bf5b83") << 29U << 17U << 2.2 << QQuaternion(1, QVector3D(0.639648, 0.328125, 0)) diff --git a/src/edid.cpp b/src/edid.cpp --- a/src/edid.cpp +++ b/src/edid.cpp @@ -407,8 +407,12 @@ { /* this is always 13 bytes, but we can't guarantee it's null * terminated or not junk. */ - auto text = QString::fromLocal8Bit(reinterpret_cast(data), 13); + auto text = QString::fromLatin1(reinterpret_cast(data), 13).simplified(); - // Remove newlines, extra spaces and stuff - return text.simplified(); + for (int i = 0; i < text.length(); ++i) { + if (!text.at(i).isPrint()) { + text[i] = '-'; + } + } + return text; }