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):

当前设置


     本文转自fengyuzaitu 51CTO博客,原文链接:http://blog.51cto.com/fengyuzaitu/1953536,如需转载请自行联系原作者


相关文章
|
5月前
|
JSON Java 数据格式
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
|
7月前
|
存储
tracker_query_storage fail, error no: 28, error info: No space left on device
tracker_query_storage fail, error no: 28, error info: No space left on device
175 0
|
JSON 数据格式
JsonParseException: Unexpected character (‘ï‘ (code 239)): was expecting comma to separate Object
JsonParseException: Unexpected character (‘ï‘ (code 239)): was expecting comma to separate Object
276 0
Newline required at end of file but not found.
Newline required at end of file but not found.
193 0
Newline required at end of file but not found.
|
应用服务中间件 nginx Windows
1113: No mapping for the Unicode character exists in the target multi-byte code page
1113: No mapping for the Unicode character exists in the target multi-byte code page
757 0
1113: No mapping for the Unicode character exists in the target multi-byte code page
|
Windows
Illegal character in opaque part at index
Illegal character in opaque part at index
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3