Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. why some characters are not recognized?
QtWS25 Last Chance

why some characters are not recognized?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
10 Posts 2 Posters 686 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.
  • E Offline
    E Offline
    Eidus
    wrote on last edited by
    #1

    Hi,
    I have a problem recognizing the letters of a regional language.
    QTextCodec :: codecForName ("UTF-8") - does not help.
    Although everything is fine in the database - Application Output does not recognize the characters I need - Ą-Ę-Ė-Į-Ū-Ų-Č and others.
    I write:
    QTextCodec::codecForName("UTF-8");
    QString test = QString::fromUtf8("\u0104\u0118\u0116\u012e\u016a\u0172\u017d\u0160\u010c");
    qDebug() << "should be: Ą-Ę-Ė-Į-Ū-Ų-Ž-Š-Č, actually shown: " <<test;
    return 0;

    In Application Output I have:
    Starting C:....build-Pope-Desktop_Qt_5_9_1_MinGW_32bit-Debug\debug\try.exe...
    should be: A-E-E-I-U-U-Ž-Š-C, actually shown: "AEEIUUŽŠC"
    Only 2 characters are displayed correctly.
    What is the solution to this problem?

    1 Reply Last reply
    0
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on last edited by
      #2

      Hi, this is an almost 10 year old bug/feature in Qt Creator
      As you say, it's only a problem in Application Output, for example if you do a QLabel->setText() on the string it will display correctly.
      Anyway the recommended workaround is to go to Tools/Options/Environment in Qt Creator's menu and change the "Text codec for tools" from "System" to something else...

      1 Reply Last reply
      1
      • E Offline
        E Offline
        Eidus
        wrote on last edited by Eidus
        #3

        Thanks for the reply. Although I don't believe in miracles, I can't find "Text codec for tools" anywhere in QT Creator Settings. There is no in "Options-Environment-Interface", no in " ...- System", or anywhere else. QT_options.jpg

        1 Reply Last reply
        0
        • hskoglundH Online
          hskoglundH Online
          hskoglund
          wrote on last edited by
          #4

          Hi, it should be there:
          Screenshot 2022-04-19 at 15.37.41.png

          Perhaps you need to upgrade your Qt Creator, for this feature to exist you need version 4.15 of Qt Creator (or later).

          E 1 Reply Last reply
          2
          • hskoglundH hskoglund

            Hi, it should be there:
            Screenshot 2022-04-19 at 15.37.41.png

            Perhaps you need to upgrade your Qt Creator, for this feature to exist you need version 4.15 of Qt Creator (or later).

            E Offline
            E Offline
            Eidus
            wrote on last edited by
            #5

            QT Creator in my computer - version 4.3.1
            Very strange situation ...

            1 Reply Last reply
            0
            • hskoglundH Online
              hskoglundH Online
              hskoglund
              wrote on last edited by
              #6

              That explains it, your version of Qt Creator is from summer of 2017 but the version required is from May last year.

              1 Reply Last reply
              0
              • E Offline
                E Offline
                Eidus
                wrote on last edited by
                #7

                thank you very much

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  Eidus
                  wrote on last edited by
                  #8

                  However, this advice does not help. QT Creator has been updated, Text codec for tools is set to UTF-8, but the required characters are not displayed.

                  1 Reply Last reply
                  0
                  • hskoglundH Online
                    hskoglundH Online
                    hskoglund
                    wrote on last edited by
                    #9

                    Hi, I just tried on Ubuntu 20.04 using Qt 5.15.2 with gcc 9.4 with the Text codec set to UTF-8 in Qt Creator (like in my screenshot above):
                    Screenshot 2022-04-21 at 15.52.21.png

                    Maybe you also need to upgrade your version of Qt...

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      Eidus
                      wrote on last edited by
                      #10

                      I installed QT on 3 computers - version QT 6.2.3, QT Creator - version 7.0.0. On one computer, everything works fine - and you don't even need to set UTF-8 there - even if you set the text codec for tools - LatinArabic - still shows the required characters. On the other two computers, including the one that previously failed to see the required characters, nothing can be done - the Ą-Č-Ę characters did not and do not show. Apparently the problem is somewhere else ... Thank you for paying attention to this issue

                      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