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

QStringLiteral bug

    XMLWordPrintable

Details

    Description

      QStringLiteral works well on standard ASCII characters but fail on unicode (at least in my case). I have in my code copyright sign, mean: ©, and when I don't use QStringLiteral it works well. But when I use it it produce artefact. This effect was showed on the picture atached.

      Example code is extremally simple:

      // QMessageBox::about(this, tr("About"), QString("%1 %2\n\n©%4 by %3")

      QMessageBox::about(this, tr("About"), QString(QStringLiteral("%1 %2\n\n©%4 by %3"))

      .arg(QCoreApplication::applicationName())

      .arg(QCoreApplication::applicationVersion())

      .arg(QCoreApplication::organizationName())

      .arg(gCopyrightYears)); 

      Copy this to some dumb project and you will see something like my screenshot (attached).

      Try uncomment first line (and comment the second one) and you see correct copyright sign without artefact.

      Attachments

        1. textprofan about bug.png
          textprofan about bug.png
          5 kB
        2. utf-8AndMsvc2017.zip
          5 kB
        3. utf-8correct.png
          utf-8correct.png
          147 kB
        4. utf-8wrong.png
          utf-8wrong.png
          176 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            szyk Szyk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes