Use QByteArray overloads of QString::from{Utf8,Latin1}
Fixes the build with QT_NO_CAST_FROM_BYTEARRAY. Pick-to: 6.9 6.8 6.5 Change-Id: I7d26235cbb9d26dc4b6d12a68a5ae494574b82a2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
f7db58335b
commit
ce38df4461
@ -2941,7 +2941,7 @@ QUrl QUrl::fromEncoded(QByteArrayView input, ParsingMode mode)
|
|||||||
QString QUrl::fromPercentEncoding(const QByteArray &input)
|
QString QUrl::fromPercentEncoding(const QByteArray &input)
|
||||||
{
|
{
|
||||||
QByteArray ba = QByteArray::fromPercentEncoding(input);
|
QByteArray ba = QByteArray::fromPercentEncoding(input);
|
||||||
return QString::fromUtf8(ba, ba.size());
|
return QString::fromUtf8(ba);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -55,7 +55,7 @@ static QString encodeByteArray(const QCborContainerPrivate *d, qsizetype idx, QC
|
|||||||
else
|
else
|
||||||
data = data.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
data = data.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||||
|
|
||||||
return QString::fromLatin1(data, data.size());
|
return QString::fromLatin1(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString makeString(const QCborContainerPrivate *d, qsizetype idx,
|
static QString makeString(const QCborContainerPrivate *d, qsizetype idx,
|
||||||
|
@ -343,9 +343,9 @@ QString QAsn1Element::toString() const
|
|||||||
if (mType == PrintableStringType || mType == TeletexStringType
|
if (mType == PrintableStringType || mType == TeletexStringType
|
||||||
|| mType == Rfc822NameType || mType == DnsNameType
|
|| mType == Rfc822NameType || mType == DnsNameType
|
||||||
|| mType == UniformResourceIdentifierType)
|
|| mType == UniformResourceIdentifierType)
|
||||||
return QString::fromLatin1(mValue, mValue.size());
|
return QString::fromLatin1(mValue);
|
||||||
if (mType == Utf8StringType)
|
if (mType == Utf8StringType)
|
||||||
return QString::fromUtf8(mValue, mValue.size());
|
return QString::fromUtf8(mValue);
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user