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

qsTr() breaks unicode characters

XMLWordPrintable

    • 27e77b7ceeeffe9227b5b96fdd63e3433e0eb63e

      Using unicode characters such as Unicode Character 'SUBSCRIPT TWO' (U+2082) works in QML, but wrapping the string in qsTr() breaks the display of the text.

      Example :
      text: "H\u2082O" //works
      text: qsTr("H\u2082O") //does not work

      As a workaround it is possible to set the textFormat to be rich text, and then specify the character in HTML encoding :

      textFormat: Text.RichText
      text: qsTr("H₂O") //works

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

            kenthans Kent Hansen (Inactive)
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes