Details
-
Task
-
Resolution: Fixed
-
P3: Somewhat important
-
6.7.3
-
25b0580ec (dev)
Description
It is sometimes useful to have the data in UTF-16, either because it cannot be represented in 8-bit or because a common use case is to return QStrings from them, which can then be fromRawData()'ed instead of requiring a heap allocation.
Acceptance criterion:
- all existing tests still pass
- the following new tests don't fail:
{ constexpr auto table = qOffsetStringArray(u8"Foo", u8"Bar"); QVERIFY(table.viewAt(0) == u8"Foo"); // returns QUtf8StringView QVERIFY(table.viewAt(1) == u8"Foo"); } { constexpr auto table = qOffsetStringArray(u"Foo", u"Bar"); QVERIFY(table.viewAt(0) == u"Foo"); // returns QStringView QVERIFY(table.viewAt(1) == u"Bar"); }
std::byte version's name to be bikeshedded.
Attachments
Issue Links
- relates to
-
QTBUG-104135 Impact of C++20 char8_t on our code
-
- Open
-
For Gerrit Dashboard: QTBUG-100556 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
578400,10 | QOffsetStringArray: add support for UTF-8 and UTF-16 arrays | dev | qt/qtbase | Status: MERGED | +2 | 0 |