[Resolved] Fonts not rendering for characters with accents and east asian languages



  • I am adding the names of the langauges into a listview.

    @ui->CurrentLanguageList->addItem("English");
    ui->CurrentLanguageList->addItem("Deutsch");
    ui->CurrentLanguageList->addItem("Español");
    ui->CurrentLanguageList->addItem("Français");
    ui->CurrentLanguageList->addItem("Italiano");
    ui->CurrentLanguageList->addItem("日本語");
    ui->CurrentLanguageList->addItem("한국어");@

    however, I am getting gibberish at runtime on anything with a special character (all asian, N of espanol, C of francais, etc) and it takes 5 seconds for the screen to render, when those characters are involved. My listview font is Lucida Grande, 12. Should I use a different font? isn't QT supposed to be handling this for me?


  • Moderators

    My guess would be that the encoding of your file can not handle the characters.

    You might also have a problem with the implicit conversion from the text string into unicode. I always use QString::fromUtf8("some string") in situations like this to make sure I will get the right encoding (which must match the encoding the source file is in!).



  • QString::fromUtf8 did the trick. much thanks.


Log in to reply
 

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