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

    • Icon: User Story User Story
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • None

      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!

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

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

              Created:
              Updated:

                There are no open Gerrit changes