QT starts by default is Utf-8, and VS2013 default program is encoded as gb2312;
This will find the use of Chinese language when garbled.
There are generally two solutions:
1. When using Chinese, use Qtextcodec
Qtextcodec *gbk=qtextcodec::codecforname ("gb2312");
QString Str=gbk->tounicode ("Chinese");
This is more cumbersome to use, it is recommended to use the second
2. Change the "Newc++file.cpp" and "hfile.h" files in the "Microsoft Visual Studio 12.0\vc\vcprojectitems" directory. Add a similar to the inside:
#pragma once
#pragma execution_character_set ("Utf-8")
Force no Signature Utf-8
Such a sentence with Chinese or other multi-character encoding, and then save as 65001 Utf-8 no signature on OK.
Recommend this.
And then set MySQL to Utf-8 encoding so there's no problem.
Http://www.cnblogs.com/lanye/p/4146114.html
VS2013 Qt5 MySQL Chinese coding problem