VS项目中经常会遇到这样的warning:
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
-
点确定后编译