Ensure UTF-8 strings

This commit is contained in:
Anton Thomasson 2020-02-23 10:54:35 +01:00
parent 2ed80100f0
commit 3f3624559b

View file

@ -268,8 +268,12 @@ Bytestream IppMsg::encode_attr(quint8 tag, QString name, QJsonValueRef value)
case Charset: case Charset:
case NaturalLanguage: case NaturalLanguage:
case MimeMediaType: case MimeMediaType:
req << quint16(value.toString().length()) << value.toString().toStdString(); {
QByteArray tmpstr = value.toString().toUtf8();
req << quint16(tmpstr.length());
req.putBytes(tmpstr.data(), tmpstr.length());
break; break;
}
default: default:
qDebug() << "uncaught tag" << tag; qDebug() << "uncaught tag" << tag;
Q_ASSERT(false); Q_ASSERT(false);