Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT_UNICODE_LITERAL() and QStringLiteral(u"stringLiteral") is the 'u' needed anymore?
Forum Updated to NodeBB v4.3 + New Features

QT_UNICODE_LITERAL() and QStringLiteral(u"stringLiteral") is the 'u' needed anymore?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 377 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tummon
    wrote on last edited by
    #1

    The docs reference using QStringLiteral() along with the UTF16 literal 'u'
    https://doc.qt.io/qt-6/qstring.html#QStringLiteral

    As well a Note: Some compilers have bugs encoding strings containing characters outside the US-ASCII character set. Make sure you prefix your string with u in those cases. It is optional otherwise.

    But in "qtbase\src\corelib\text\qstringliteral.h"

    #define QT_UNICODE_LITERAL(str) u"" str
    

    Is used exclusively in both Qt5.15 and Qt6.4

    Is prepending the 'u' necessary anymore for any use case?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved