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
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
