Nominate our 2022 Qt Champions!

Some multibyte characters no longer drawn following version update

  • When I was building against the (pre-built) Qt5.3 release my application was displaying some UTF8 characters correctly. Since upgrading to Qt5.4.1 (pre-built), some characters are no longer displayed. It's as if they are no longer in the font; however, the application has not changed, and is using the stock Ubuntu style font.

    An example is the hex sequence: 24 e2 82 ac c2 a2 f0 90 8d 88
    which translates to: $โ‚ฌยข๐ˆ
    In Qt5.4.1 the last character, ๐ˆ, is displayed as a square (usually the 'missing' character symbol).

    Is there something I've missed here?

  • Hi,
    can you please provide a complete qDebug() << ... ; line so I can test it?

  • @Wieland

    It looks like the output from qDebug() varies depending on whether it is sent to the terminal, or the Qt Creator Application Output pane.

    However, putting the text into an edit widget shows up different (5.3 vs 5.4.1) on my system:

    #include <QApplication>
    #include <QMainWindow>
    #include <QPlainTextEdit>
    #include <QDebug>
    int main(int argc, char *argv[])
        QApplication a(argc, argv);
        QMainWindow w;
        QPlainTextEdit edit(&w);
        char c[] = {0x24, (char)0xe2, (char)0x82, (char)0xac, (char)0xc2, (char)0xa2, (char)0xf0, (char)0x90, (char)0x8d, (char)0x88, 0};
        qDebug() << QString::fromUtf8(c);
        return a.exec();

    I also tried against the git 5.5 code: the characters (in the edit) appear OK again, although the qDebug() output has changed significantly there ("$\u20AC\u00A2\U00010348").

  • Tested it on Ubuntu 15.04 with Qt 5.4.0: Same result here: I get the correct result only in a Terminal window. Interesting.

  • Can't even copy and paste it into QtCreator. Doesn't show up correctly in Kate but in Firefox...

Log in to reply