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. Weird Unicode problem with Qt 5.15.0 and MSVC 2019...
Forum Updated to NodeBB v4.3 + New Features

Weird Unicode problem with Qt 5.15.0 and MSVC 2019...

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 654 Views 2 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.
  • pedrogkbP Offline
    pedrogkbP Offline
    pedrogkb
    wrote on last edited by
    #1

    I've started using MSVC to build my project, It does everything very well, but I have found an error that I'm not sure whats the cause. In the program 95% of the places where Unicode characters are used, they display correctly, but the same words and characters in other places are not, showing the ? sign.
    I've noticed that it happens where I put a string without assigning it to a QString, like this:

    ui->comboGenero->addItem("Fêmea", 0);
    

    The same code like this, works normally:

    ui->comboGenero->addItem(QString("Fêmea"), 0);
    
    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, in MSVC 2019's Tools, Options, Text Editor, General settings, do you have the checkbox "Auto-detect UTF-8 encoding without signature" enabled? Try disabling it.
      Also check that your .cpp file does not have a BOM (byte order mark) at the beginning (if you open the .cpp file with a binary hex editor the first bytes are FF FE something)

      1 Reply Last reply
      3
      • pedrogkbP Offline
        pedrogkbP Offline
        pedrogkb
        wrote on last edited by
        #3

        Thank you so much for the fast and assertive answer.
        Inside Options > Text Editor > Behavior > File Encodings, the UTF-8 BOM option was set to "Keep If already Present", changed it to "Always Delete" and problem solved.

        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