GUI: Fix handling UTF-8 strings in sources.
Our source files are UTF-8 and as such contain some chars outside 7-bit ASCII. To handle UTF-8 correctly we must set text codec for QT to UTF-8.
This commit is contained in:
parent
9cd5558f5e
commit
d0757c5797
|
@ -18,6 +18,7 @@
|
|||
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTextCodec>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
@ -25,6 +26,10 @@ int main(int argc, char *argv[])
|
|||
QApplication app(argc, argv);
|
||||
app.setWindowIcon(QIcon(":icon.png"));
|
||||
|
||||
// Set codecs so that UTF-8 strings in sources are handled correctly.
|
||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
MainWindow window;
|
||||
window.show();
|
||||
return app.exec();
|
||||
|
|
Loading…
Reference in New Issue