Browse Source

Set TextCodec to UTF8

For now QTextEdit seems handle the Chinese correctly.

Signed-off-by: Le Tan <[email protected]>
Le Tan 9 years ago
parent
commit
e1c2204733
1 changed files with 5 additions and 0 deletions
  1. 5 0
      main.cpp

+ 5 - 0
main.cpp

@@ -1,10 +1,15 @@
 #include "vmainwindow.h"
 #include <QApplication>
+#include <QTextCodec>
 
 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
 
+    QTextCodec *codec = QTextCodec::codecForName("UTF8");
+    if (codec) {
+        QTextCodec::setCodecForLocale(codec);
+    }
     VMainWindow w;
     w.show();