Showing unicode characters in a QString on mac
-
Hi,
I have the following code:@
#include <QApplication>
#include <QString>
#include <QLabel>int main(int argc, char *argv[])
{QApplication app(argc, argv); QWidget fenetre; QLabel texte("éèê", &fenetre); fenetre.show(); return app.exec();
}
@and it shows éèê
How can I use unicode in a window on MAC?
Thanks!
-
Since QLabel takes a QString, you can write
@
QLabel texte(QString::fromUtf8("éèê"), &fenetre);
@For non-Qt programs, you need to use C++11's Unicode support: http://en.wikipedia.org/wiki/C++11#New_string_literals