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,如需转载请自行联系原作者


相关文章
|
2月前
|
Docker 容器
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
ADD failed: file not found in build context or excluded by .dockerignore: stat irap_rule_center: fil
|
4月前
|
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
EnvironmentNotWritableError: The current user does not have write permissions to the targe...
EnvironmentNotWritableError: The current user does not have write permissions to the targe...
1894 0
|
JSON 数据格式
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
Newline required at end of file but not found.
Newline required at end of file but not found.
179 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
694 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
成功解决ValueError: Number of passed names did not match number of header fields in the file
成功解决ValueError: Number of passed names did not match number of header fields in the file
成功解决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