Encoding settings
If your build environment is not set to UTF-8, encoding mismatches may cause errors during text input/output.
Configuration (Windows)
Include the /utf-8 option when building the project.
Visual Studio example
- In Solution Explorer, right-click and open the project Properties
- In the Properties page, go to Configuration Properties > C / C++ > Command Line
- Add /utf-8 to the Additional Options field
CMake example
if(MSVC)
add_compile_options(/utf-8)
endif()