Problem with accents on QT desktop application. QT5 on Windows (Visual Studio 11)



  • Hi All,

    My desktop QT app do not render accents correctly! For instance, if I use: 'é', it show an '?' in place.

    QT5 on Windows (Visual Studio 11)

    Anyone can help!



  • @retf Are you currently just entering the special characters at the keyboard? You may get better results if you look up the codes to represent the symbols as QChars, and enter them instead.

    For example, I recently needed to display a label for a length quantity measured in microns. Cutting and pasting the 'mu' symbol from Windows Character Map into my Visual Studio source code looked just fine, but when I compiled and ran the code the 'mu' came up as a '?'. Instead, I changed my code to:

    tr("Thickness (%1m)").arg(QChar(0xB5))

    ...and this gave me exactly what I wanted.



  • This could be an encoding problem. Make sure you are using utf-8 as the file encoding for your source files.



  • Assuming your talking about display of characters, not input as stated in a previous reply, please check that you're doing proper translations with Qt Linguist, and that the generated XML (.ts) files have the proper encoding for the accented characters (UTF-8 for instance). I work usually with Spanish translations and I have no issues dealing with á, é, í and so on.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.