Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-98763

Replace uses of QString:::utf16() with QString::(const)data()

    XMLWordPrintable

    Details

    • Type: Task
    • Status: In Progress
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Story Points:
      8
    • Sprint:
      Team 2 Foundation_Sprint 48, Team Two Foundation Sprint 49, Team Two Foundation Sprint 50, Team Two Foundation Sprint 51

      Description

      The utf16() function guarantees a NUL-terminated UTF-16 string, and will reallocate when it can't be sure (most prominently, from objects constructed fromRawData()). Some code uses this function just because it returns a ushort* instead of a (const) QChar*, to avoid a reinterpret_cast, but invokes the detach() path for common QString objects such as {{QStringLiteral}}s.

      So, search for, and replace with QString::(const)data(), all uses of QString::utf16() that don't actually need the NUL-termination.

      QStringView::utf16() is not affected, and should stay.

      The casual use of utf16() has caused QTBUG-98653. Who knows what else is brewing.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            oyheskes Øystein Heskestad
            Reporter:
            mmutz Marc Mutz
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            RnD Owner:
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: