Visual Studio Compilation Character Set [Converted]
C++ cross-platform development. Commonly encountered on Chinese operating systems: error C2001 - constant contains a newline character.
Visual Studio
cmake organizes the project compilation script, generating a temporary solution under the windows system for development. The reason for cross-platform compatibility is that the file encoding is chosen as utf-8.
The cited reference provides a detailed explanation of the causes of the problem from first principles.
Regarding encoding, MSVC has dedicated compilation options /source-charset and /execution-charset. The former indicates the encoding of the file itself, and the latter indicates what encoding the byte array inside the compiled character set is. Encoding issues can basically be solved using these two options.