Apologies, ignore my last message , I see the issue now... There is a problem with u"" "myString" (like the macro QStringLiteral uses) vs. u"mystring".
Thanks for your time! -----Original Message----- From: Cathal Tummon (ctummon) Sent: 05 January 2023 16:31 To: Thiago Macieira <thiago.macie...@intel.com>; interest@qt-project.org Subject: RE: [Interest] QStringLiteral and UTF-16 string literal "u" Sorry to drag this out, but even if my compiler is broken. By the looks of it I do not need to manually add the "u" , it seems to be added by the QStringLiteral() macro itself? -----Original Message----- From: Thiago Macieira <thiago.macie...@intel.com> Sent: 05 January 2023 16:20 To: interest@qt-project.org Cc: Cathal Tummon (ctummon) <ctum...@cisco.com> Subject: Re: [Interest] QStringLiteral and UTF-16 string literal "u" On Thursday, 5 January 2023 11:54:58 -03 Cathal Tummon (ctummon) via Interest wrote: > Sorry to clarify, I'm not questing why it is needed, my question is, > is the following redundant: QStringLiteral(u"myText") > > As in the source code for QStringLiteral there is another macro: > #define QT_UNICODE_LITERAL(str) u"" str > > Which always seems to be used, is that correct? Correct. The u is not required for any compliant compiler. The problem is only if your compiler is broken (i.e., MSVC). See the discussion on commit d80b0eb12c477592b590b768e21dc26c137beadc[1] and on the MSFT bug report. [1] https://code.qt.io/cgit/qt/qtbase.git/commit/? id=d80b0eb12c477592b590b768e21dc26c137beadc -- Thiago Macieira - thiago.macieira (AT) intel.com Cloud Software Architect - Intel DCAI Cloud Engineering _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest