/execution-charset (Set Execution Character Set)
Lets you specify the execution character set for your executable.
The IANA-defined character set name.
The code page identifier.
You can use the /execution-charset option to specify an execution character set. The execution character set is the encoding used for the text of your program that is input to the compilation phase after all preprocessing steps. This character set is used for the internal representation of any string or character literals in the compiled code. Set this option to specify the extended execution character set to use when your source files include characters that are not representable in the basic execution character set. You can use either the IANA or ISO character set name, or a dot (.) followed by a 3 to 5 digit decimal code page identifier to specify the character set to use. For a list of supported code page identifiers and character set names, see Code Page Identifiers.
By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes the source file is encoded using the current user code page, unless you have specified a character set name or code page by using the /source-charset option or the /utf-8 option. Visual Studio allows you to save your C++ source code by using any of several character encodings. For information about source and execution character sets, see Character Sets in the language documentation.
If you want to set both the source character set and the execution character set to UTF-8, you can use the /utf-8 compiler option as a shortcut. It is equivalent to specifying /source-charset:utf-8 /execution-charset:utf-8 on the command line. Any of these options also enables the /validate-charset option by default.
To set this compiler option in the Visual Studio development environment
Open the project Property Pages dialog box. For more information, see Set C++ compiler and build properties in Visual Studio.
Expand the Configuration Properties, C/C++, Command Line folder.
In Additional Options, add the /execution-charset option, and specify your preferred encoding.
Choose OK to save your changes.
MSVC Compiler Options
MSVC Compiler Command-Line Syntax
/source-charset (Set Source Character Set)
/utf-8 (Set Source and Executable character sets to UTF-8)
/validate-charset (Validate for compatible characters)