c++ - visual studio控制台应用程序中文乱码?
PHP中文网
PHP中文网 2017-04-17 13:30:18
0
1
954

就只调用了printf函数打印了一句话,里面包括中文,结果乱码了。

网上说的这个解决方法并不管用:

包含头文件:#include <locale.h>
函数:_tsetlocale(LC_ALL, _T("chs"));

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
伊谢尔伦

Please confirm the encoding format of the .cpp file where your code is located (the file created by vs should be ANSI, but if your file is created in other ways, it may not be ANSI) and your console (windows defaults to ANSI ) encoding format, these two formats need to be consistent.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template