Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QsTr() and non-ASCII characters
Forum Updated to NodeBB v4.3 + New Features

QsTr() and non-ASCII characters

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.6k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    ludde
    wrote on last edited by
    #1

    Has anyone successfully used qsTr() with a source string containing non-ASCII Latin-1 characters? I just cannot make it work.
    Especially not with Qt 4.8.2. Using 4.7.4 it seems to work on the target Windows CE device, but not on Windows. Using 4.8.2, there seems to be an additional conversion to UTF-8, which makes the string get an extra Â. This means no translation is found, because the translation file does not contain the extra Â, and the string returned by qsTr() is the string with the extra Â.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      There was a known issue with this in 4.7, but it should be working in 4.8 (see https://bugreports.qt-project.org/browse/QTBUG-14989 for details). I'd suggest opening a new bug if this isn't working correctly in 4.8.2.

      Regards,
      Michael

      1 Reply Last reply
      0
      • L Offline
        L Offline
        ludde
        wrote on last edited by
        #3

        The bug report deals with non-Latin-1 characters, my problem is with Latin-1 characters.
        I made a simple example which works as expected on Windows with 4.7.4, but does not work with 4.8.2 (or 4.8.0). I will file a bug report for this.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          Hi,

          Oops, sorry for the confusion. One other thing you could check is the encoding of the QML file, as the QML engine expects all files to be UTF-8 encoded.

          Regards,
          Michael

          1 Reply Last reply
          0
          • L Offline
            L Offline
            ludde
            wrote on last edited by
            #5

            QML file is UTF-8, C++ files are Latin-1.
            Filed a bug report for this as "QTBUG-26193":https://bugreports.qt-project.org/browse/QTBUG-26193.

            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