Original vs New source file The default encoding is selected according to the system locale. My is GB 2312. I'm the grass. But I'm dead. Have not known.
It was mainly necessary to use Doxygen to generate HTML documents, the default input file format is UTF-8, is not with the BOM. I use notepad++ all to convert the source file into UTF-8 with the BOM encoding format. Then I opened the project again with VS, and the results were compiled.
Warning C4819: The file contains characters that cannot be represented in the current code page (936). Please save the file in Unicode format to prevent data loss
And reported a strange mistake about it. The reason is that there are non-visible characters in the file. (BOM header).
Analyze the following process:
Originally the original source file is not with the BOM header.
It was later converted to notepad++ with a BOM head. is the UTF-8 encoding format on the notepad++ (it is with the BOM by default)
Later did not turn back, using a BOM, VS's current code page is not with the BOM. So just say there are characters that are not visible. So I compiled an error.
So. Click the Select File, select the Advanced save option for the file in the VS menu bar, and select the UTF-8 signed code page.
References
http://blog.csdn.net/enjoy517905407/article/details/37958035
Default encoding for Visual studio new source files