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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The file contains a character that cannot be represented in the current code page相关的知识,希望对你有一定的参考价值。

场景说明:

    环境:VS2005,编辑C++代码,在类的构造函数的初始化列表中删除最后一个初始化变量,出现如下的错误:

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编码,可能导致数据丢失

代码简单如下:

    A::A():m_a(false),m_b(false).....,m_z(false)

{

}

删除最后一个m_z出现上述的问题,如果这种情况下,将左括号放在最后就不会出现任何的问题。


解决方案:

Ctrl+A选中当前的文档,然后点击文件,然后选中高级保存选项,在弹出的窗口中,选择如下:

编码(E):

Unicode(UTF-8带签名) - 代码页65001

行尾(L):

当前设置


以上是关于The file contains a character that cannot be represented in the current code page的主要内容,如果未能解决你的问题,请参考以下文章

(转)The windows boot configuration data file dose not contain a valid OS entry

debug网页时小问题The source attachment does not contain the source for the file

the source attachment does not contain the source for the file xxx.class无法关联到某个类

Referenced file contains errors For more information, right click on the message in the Problems V

An error occured while deploying the file. This probably means that the app contains ARM native code

WARNING: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.