warning C4819: The file contains a character that cannot be represented in the current code page

来源:互联网 发布:淘宝解锁苹果id可靠吗 编辑:程序博客网 时间:2024/04/29 07:31

VC程序编译时出现 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编码的字符,建议把文件保存为Unicode格式以避免数据丢失。


造成出现此警告的原因可能是该源文件之前有用别的文本编辑器打开并转换了文件的编码格式,我就是用了Visual Studio Code转换成了UTF-8格式。


解决方法 1:在VS中打开该源文件 -> Ctrl+A 全选 -> 菜单栏 File -> Advanced save options -> 选择编码方式:Unicode - codepage 1200 即可;

解决方法 2:在VS中打开该源文件 -> Save As 另存为 -> 在保存按钮下拉选择 Save with encoding -> 选择编码方式:Unicode - codepage 1200 即可。

阅读全文
0 0
原创粉丝点击