From e1c220473376dd8dd1f02a3cc70871cde65bb465 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Mon, 10 Oct 2016 17:04:27 +0800 Subject: [PATCH] Set TextCodec to UTF8 For now QTextEdit seems handle the Chinese correctly. Signed-off-by: Le Tan --- main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.cpp b/main.cpp index 05879475..e5390f42 100644 --- a/main.cpp +++ b/main.cpp @@ -1,10 +1,15 @@ #include "vmainwindow.h" #include +#include int main(int argc, char *argv[]) { QApplication app(argc, argv); + QTextCodec *codec = QTextCodec::codecForName("UTF8"); + if (codec) { + QTextCodec::setCodecForLocale(codec); + } VMainWindow w; w.show();