The UTF-8 support in Qt is still lacking, so QUtf8StringView doesn't,
yet, have the likes of contains(), endsWith(), etc that the existing
QString code uses in Q_ASSERTs.
Provide free functions that work for UTF-8 haystacks and ASCII needles
by falling back to QByteArrayView or QLatin1StringView.
Also break a replace() use into a series of indexOf() + chunked
write(). This is rather expensive for QString, so port the
writeCDATA() function that uses this to QAnyStringView already, ahead
of the bulk of the changes in Mate's follow-up patch.
Task-number: QTBUG-103302
Change-Id: Ic66261740817ede2600b78a383cf667a31df7bfc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>