warning c4819 in Visual Studio C++ 2013 express - utf8 files without bom

后端 未结 4 1140
慢半拍i
慢半拍i 2021-01-03 03:39

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 trea

4条回答
  •  旧巷少年郎
    2021-01-03 04:01

    If your system locale is not English (E.g. Chinese or other language), a simple way to fix this is to change your system setting of 'Region and Language' to be English. Just follow steps below:

    Control Panel -> Clock,Language,and Region -> Region and Language -> 
    Administrative -> Language for non-Unicode programs -> Change system locale.
    

    Is that simple? It fixes my problem as my system locale is Chinese. The description of 'Language for non-Unicode programs' is clear:

    This setting (system locale) controls the language used when displaying 
    text in programs that do not support Unicode.
    

    More details in the image

    I met this problem when I tried to build my project on Windows, which is successful on another Windows machine. I was crazy to modify all non-Unicode characters (All of then are comments) and so that compiler could move on. But there are too many files with this problem.

提交回复
热议问题