The EDID 1.4 spec states that string descriptors with length less than
13 are terminated with \n and padded with spaces. Since we sanitize the
string by replacing non-printable characters with '-', we can't start
out by replacing \n and \r with \0 to simulate a zero-terminated string,
as these null bytes will then be replaced with '-'. And even if they
were not, QQtring::fromLatin1(QByteArray) in Qt 6 will include any null
bytes verbatim as Unicode null characters, so we'd still end up with
a wrongly parsed string.
We simplify the process by following the spec, truncating the byte array
at the first occurrence of \n (without any check that the following bytes
are pure padding), and then doing the non-printable character replacement.
Pick-to: 6.5 6.2
Change-Id: I9f4e77ddb7b1b759c08b94b29e28d8c148b5435f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>