summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/watchutils.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2011-07-04 18:31:31 +0200
committerhjk <qthjk@ovi.com>2011-07-13 17:13:43 +0200
commiteb1b3fb0c380635574504b47700796f53d12ade5 (patch)
tree66cca0de459c5c6e7d346ce38edf746091643f53 /src/plugins/debugger/watchutils.cpp
parent98c116491f2fd040d11e7117177a0820b89093d0 (diff)
downloadqt-creator-eb1b3fb0c380635574504b47700796f53d12ade5.tar.gz
debugger: make local 8 bit available for displaying char *
Change-Id: I4608f3f861b8f06889199e0401e3b7569587be11 Reviewed-on: http://codereview.qt.nokia.com/1232 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/watchutils.cpp')
-rw-r--r--src/plugins/debugger/watchutils.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp
index ba7304e164..7356f31978 100644
--- a/src/plugins/debugger/watchutils.cpp
+++ b/src/plugins/debugger/watchutils.cpp
@@ -559,27 +559,23 @@ QString decodeData(const QByteArray &ba, int encoding)
case Hex2EncodedLatin1: { // 6, %02x encoded 8 bit Latin1 data
const QChar doubleQuote(QLatin1Char('"'));
const QByteArray decodedBa = QByteArray::fromHex(ba);
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromLatin1(decodedBa) + doubleQuote;
}
case Hex4EncodedLittleEndian: { // 7, %04x encoded 16 bit data
const QChar doubleQuote(QLatin1Char('"'));
const QByteArray decodedBa = QByteArray::fromHex(ba);
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUtf16(reinterpret_cast<const ushort *>
(decodedBa.data()), decodedBa.size() / 2) + doubleQuote;
}
case Hex8EncodedLittleEndian: { // 8, %08x encoded 32 bit data
const QChar doubleQuote(QLatin1Char('"'));
const QByteArray decodedBa = QByteArray::fromHex(ba);
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUcs4(reinterpret_cast<const uint *>
(decodedBa.data()), decodedBa.size() / 4) + doubleQuote;
}
- case Hex2EncodedUtf8: { // 9, %02x encoded 8 bit Utf-8 data
+ case Hex2EncodedUtf8: { // 9, %02x encoded 8 bit UTF-8 data
const QChar doubleQuote(QLatin1Char('"'));
const QByteArray decodedBa = QByteArray::fromHex(ba);
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUtf8(decodedBa) + doubleQuote;
}
case Hex8EncodedBigEndian: { // 10, %08x encoded 32 bit data
@@ -593,7 +589,6 @@ QString decodeData(const QByteArray &ba, int encoding)
decodedBa[i + 1] = decodedBa.at(i + 2);
decodedBa[i + 2] = c;
}
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUcs4(reinterpret_cast<const uint *>
(decodedBa.data()), decodedBa.size() / 4) + doubleQuote;
}
@@ -605,16 +600,19 @@ QString decodeData(const QByteArray &ba, int encoding)
decodedBa[i] = decodedBa.at(i + 1);
decodedBa[i + 1] = c;
}
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUtf16(reinterpret_cast<const ushort *>
(decodedBa.data()), decodedBa.size() / 2) + doubleQuote;
}
case Hex4EncodedLittleEndianWithoutQuotes: { // 12, see 7, without quotes
const QByteArray decodedBa = QByteArray::fromHex(ba);
- //qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return QString::fromUtf16(reinterpret_cast<const ushort *>
(decodedBa.data()), decodedBa.size() / 2);
}
+ case Hex2EncodedLocal8Bit: { // 13, %02x encoded 8 bit UTF-8 data
+ const QChar doubleQuote(QLatin1Char('"'));
+ const QByteArray decodedBa = QByteArray::fromHex(ba);
+ return doubleQuote + QString::fromLocal8Bit(decodedBa) + doubleQuote;
+ }
}
qDebug() << "ENCODING ERROR: " << encoding;
return QCoreApplication::translate("Debugger", "<Encoding error>");