StringParser delete null bytes now, SnapmaticPicture trims title
This commit is contained in:
parent
05f6091111
commit
c841a46fb7
2 changed files with 6 additions and 4 deletions
|
@ -192,15 +192,15 @@ QString SnapmaticPicture::getSnapmaticJSONString(QByteArray jsonBytes)
|
||||||
QByteArray jsonUsefulBytes = jsonBytes;
|
QByteArray jsonUsefulBytes = jsonBytes;
|
||||||
jsonUsefulBytes.replace((char)0x00, "");
|
jsonUsefulBytes.replace((char)0x00, "");
|
||||||
jsonUsefulBytes.replace((char)0x0c, "");
|
jsonUsefulBytes.replace((char)0x0c, "");
|
||||||
return QString::fromUtf8(jsonUsefulBytes);
|
return QString::fromUtf8(jsonUsefulBytes).trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SnapmaticPicture::getSnapmaticTIDEString(QByteArray tideBytes)
|
QString SnapmaticPicture::getSnapmaticTIDEString(QByteArray tideBytes)
|
||||||
{
|
{
|
||||||
QByteArray tideUsefulBytes = tideBytes;
|
QByteArray tideUsefulBytes = tideBytes;
|
||||||
tideUsefulBytes.remove(0, 4);
|
tideUsefulBytes.remove(0,4);
|
||||||
QList<QByteArray> tideUsefulBytesList = tideUsefulBytes.split(char(0x00));
|
QList<QByteArray> tideUsefulBytesList = tideUsefulBytes.split(char(0x00));
|
||||||
return QString::fromUtf8(tideUsefulBytesList.at(0));
|
return QString::fromUtf8(tideUsefulBytesList.at(0)).trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SnapmaticPicture::readingPictureFromFile(QString fileName)
|
bool SnapmaticPicture::readingPictureFromFile(QString fileName)
|
||||||
|
|
|
@ -30,5 +30,7 @@ StringParser::StringParser()
|
||||||
QString StringParser::parseTitleString(QByteArray commitBytes, int maxLength)
|
QString StringParser::parseTitleString(QByteArray commitBytes, int maxLength)
|
||||||
{
|
{
|
||||||
Q_UNUSED(maxLength)
|
Q_UNUSED(maxLength)
|
||||||
return QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed();
|
QString retStr = QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed();
|
||||||
|
retStr.remove(QChar((char)0x00));
|
||||||
|
return retStr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue