Import PDML text proto as hexdump if non-text chars

This commit is contained in:
Srivats P 2020-04-07 21:15:27 +05:30
parent 5efffb0c4b
commit c335f34651

View File

@ -101,6 +101,15 @@ _retry:
goto _retry; goto _retry;
} }
QByteArray line = QByteArray::fromHex(
attributes.value("value").toString().toUtf8());
foreach(char c, line) {
if (!isprint(c) && !isspace(c)) {
contentType_ = kOtherContent;
goto _retry;
}
}
if (pos < expPos_) if (pos < expPos_)
break; break;
@ -127,9 +136,6 @@ _retry:
expPos_ += gap; expPos_ += gap;
} }
QByteArray line = QByteArray::fromHex(
attributes.value("value").toString().toUtf8());
if (detectEol_) if (detectEol_)
{ {
if (line.right(2) == "\r\n") if (line.right(2) == "\r\n")