Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9
-
None
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"