天天看点

warning C4819的解决办法

从别处拷贝一段代码到程序运行,出现一堆的警告:

warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss。
           

这个警告提示反正就是和 Unicode 字符有关,具体是哪行也不好找。

网上推荐的方法大多是忽略,还有几个试过不行。后来找到这个很管用。

方法如下:

  • 打开出现 warning 的文件,Ctrl+A全选,
  • 然后在文件菜单:

    file->Advanced save options

  • 在弹出的选项中选择新的编码方式为:

    UNICODE- codepage 1200

    warning C4819的解决办法
  • 点确定后编译

搞定。