search

Home  >  Q&A  >  body text

c++ - visual studio控制台应用程序中文乱码?

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

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

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

PHP中文网PHP中文网2808 days ago980

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:32:18

    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.

    reply
    0
  • Cancelreply