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

As a user of Qt, I want u8 string literals to work in C++20 as they did in C++17, vis-a-vis Qt APIs

    XMLWordPrintable

    Details

    • Type: User Story
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Ever since Qt suggested to use UTF-8 encoding for the source, we've observed more and more use of u8 string literals in our code being passed to Qt APIs, to such an extent that it has become an unwritten law to do so to ensure proper encoding by the compiler (or else a warning/error), and as an indication to the reader of the code that, yes, this is supposed to be interpreted as UTF-8.

      Enter C++20 and all our code fails to compile when trying to access Qt APIs.

      This is because u8 string literals in C++17 were const char[], while in C++20 they're now {{const char8_t[]}}s. But Qt APIs, for the most part, fail to provide a corresponding overload.

      It would be counter-productive to go into our code and remove all those u8 again, so please fix your APIs!

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-99480
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              cnn Qt Core & Network
              Reporter:
              mmutz Marc Mutz
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes