Solution to warning C4819 when QtCreator compiles

Solution to warning C4819 when QtCreator compiles

Similar warnings often appear when compiling programs with QtCreator and MSVC compilers:

warning C4819: The file contains characters that cannot be represented in the current code page (936). Please save this file in Unicode format to prevent data loss

We can ignore this warning, but dozens of such warnings are often prompted when compiling larger projects. In fact, it is enough to save our code as a utf-8 file with BOM format.

QtCreator saves files in utf-8 format by default, but without BOM. We can modify the settings to keep the BOM every time we save it. The setting method is shown in the figure:

Guess you like

Origin blog.csdn.net/weiweiqiao/article/details/131296593