Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt 5.7 cannot render 'Bengali' font
I am using Qt 5.7 and within my code, there is a qdebug line with Bengali fonts.
qDebug() << "বাংলাদেশ-BD" << endl;
While running the application, I see this line outputs question marks
not the fonts. My locale settings are like this:
LANG=C.UTF-8 LANGUAGE=en LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL=C
What might possibly go wrong?
and welcome to the forums.
If you place same text on a QLabel, does it still show as ????
QDebug has issue with unicode. ( on windows )
sigmind last edited by
Yes, QLabel shows the Bengali font clearly, only qdebug() not rendering properly.
ok, so it seems qDebug still do not support full unicode on windows.
qDebug doesn't do any rendering, it prints to your console.
Does using cout get you the result you want ?
QLabel is working fine with this language, but none of std::string or QString working here, resulting in ???? (question marks instead of fonts). I am using Ubuntu 16 and Qt Creator 4.0.2 Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit).
std::cout << "বাংলাদেশ-BD!" << std::endl;
correctly prints the font like this:
However, using this font in my code crashes the program abruptly. Instead if I use
std::cout << "Bangladesh-BD!" << std::endl;
The program runs fine.
However, I am new in Qt and couldn't find how to pass the string correctly to a std::string variable so that it could render the font properly instead of Question marks.