Important: Please read the Qt Code of Conduct -

Qt Linguist unicode problem

  • Hello

    I am using Qt Linguist version 5.14.1.
    In my this is set: CODECFORSRC = UTF-8

    When I generate the ts file with the lupdate command, characters like "ä" are converted to ä (when I view the ts file with notepad++).

    If I open the ts file with linguist, the characters are displayed in the tool as "ä" -> No problem so far.

    If I save the ts file in the linguist app and then look at the ts file with Notepad++, the "ä" is no longer saved as ä but as "ä" -> No problem so far.

    If I now update the ts file again with the lupdate command, the following happens:

    • if the message with the character "ä" has no translation yet (type=unfinished) it will be converted to ä again -> no problem
    • if the message has a translation, the ä is converted to ä and is now marked as "obsolete". Therefore, another message with ä is added as ä, but of course without translation -> my problem

    Any idea what i'm doing wrong?

  • Lifetime Qt Champion

    Simply do not use non-ascii characters for your source files. Saves a lot of headaches, esp. with windows and the msvc compiler.

  • Moderators

    In my current project we're using UTF-8 in code everywhere, no problems with lupdate, lrelease and Linguist whatsoever. Maybe it's some bug with 5.14.x? Have you tried with other Qt versions?

  • @Christian-Ehrlicher Thanks for the hint. I changend the default language from german to english, so i don't have any non-asci characters in the source. Non Asci in the translations files then is no problem.

Log in to reply