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

[QTextStream] char16_t / char32_t support for QTextStream

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.9
    • None
    • Linux/X11

    Description

      trying to print different char literals:

          QTextStream out(stdout);
          using namespace Qt::Literals;
      
          out << "const char*: ";
          out << "yada";
          out << "\nconst char16_t*: ";
          out << u"yada";
          out << "\nconst char* (utf-8): ";
          out << u8"yada";
          out << "\nconst char32_t*: ";
          out << U"yada";
          out << "\nQString: ";
          out << u"yada"_s;
          out << "\n";
      

      prints:

      const char*: yada
      const char16_t*: 0x6392ed7ef0de
      const char* (utf-8): yada
      const char32_t*: 0x6392ed7ef0e8
      QString: yada
      

      on a related note:

          qDebug() << "const char*: " << "yada";
          qDebug() << "const char16_t*: " << u"yada";
          qDebug() << "const char* (utf-8): " << u8"yada";
          qDebug() << "const char32_t*: " << U"yada";
          qDebug() << "QString: " << u"yada"_s;
          qDebug() << "\n";
      

      can print char16_t, but not char32_t:

      const char*:  yada
      const char16_t*:  yada
      const char* (utf-8):  yada
      const char32_t*:  0x5564a8b401e8
      QString:  "yada"
      

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes