warning c4819 in Visual Studio C++ 2013 express - utf8 files without bom(Visual Studio C++ 2013 express 中的警告 c4819 - 没有 bom 的 utf8 文件)
问题描述
在 Visual Studio C++ 2013 express 中,除非 utf8 编码的文件具有 BOM 标记,否则编译器无法理解正在编译的文件是 UTF8 编码并将其视为本机编码.但是代码编辑器没有这个问题.
In visual studio C++ 2013 express it seems that unless utf8-encoded file has BOM mark, compiler fails to understand that the file being compiled is in UTF8 encoding and treats it as being in native encoding. Code editor, however, does not have this problem.
warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
是否有针对此行为的修复方法?我记得这是所有 Visual Studio 版本中的常见问题,但我不记得曾经看到过修复.我无法准确地为每个不属于我的文件添加 bom 标记,尤其是在代码存储库中维护源代码的情况下.
Is there a fix for this behavior? I remember this being common problem in all visual studio versions, but I don't remember ever seeing a fix. I can't exactly keep adding bom marks to every file that is not mine, especially if source is maintained in code repository.
推荐答案
到目前为止我还没有遇到任何问题的解决方案.
To the date I have not encountered any solution to the problem.
如果存在针对此行为的修复程序,则显然这是保密的.
If a fix for this behavior exists, apparently it is well guarded secret.
这篇关于Visual Studio C++ 2013 express 中的警告 c4819 - 没有 bom 的 utf8 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Visual Studio C++ 2013 express 中的警告 c4819 - 没有 bom 的 utf8 文件
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- CString 到 char* 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
