Debugger: Fix auto test and dumper for unusual strings

This handles embedded NUL and other unprintable contents.

Change-Id: Iabd59935eca83bc14b000ebb1e8901983530a3d6
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2013-02-11 17:58:52 +01:00
parent e75bc748b4
commit 5d1747c9d2
2 changed files with 45 additions and 20 deletions

View File

@@ -501,7 +501,7 @@ QString decodeData(const QByteArray &ba, int encoding)
case Hex2EncodedLatin1WithQuotes: { // 6, %02x encoded 8 bit Latin1 data
const QChar doubleQuote(QLatin1Char('"'));
const QByteArray decodedBa = QByteArray::fromHex(ba);
return doubleQuote + QString::fromLatin1(decodedBa) + doubleQuote;
return doubleQuote + QString::fromLatin1(decodedBa, decodedBa.size()) + doubleQuote;
}
case Hex4EncodedLittleEndianWithQuotes: { // 7, %04x encoded 16 bit data
const QChar doubleQuote(QLatin1Char('"'));