Does VC have a compile option like '-fexec-charset' in GCC to set the execution character set?

前端 未结 4 2135
情话喂你
情话喂你 2020-12-28 10:22

GCC has -finput-charset, -fexec-charset and -fwide-exec-charset three compile options to specify particular encodings involved in a \"

4条回答
  •  甜味超标
    2020-12-28 10:44

    The Visual Studio 2015 Update 2 and later supports setting the execution character set:

    You can use the option /utf-8 which combines the options /source-charset:utf-8 and /execution-charset:utf-8. From the link above:

    In those cases where BOM-less UTF-8 files already exist or where changing to a BOM is a problem, use the /source-charset:utf-8 option to correctly read these files.

    Use of /execution-charset or /utf-8 can help when targeting code between Linux and Windows as Linux commonly uses BOM-less UTF-8 files and a UTF-8 execution character set.

    Project Properties/Configuration Properties/General/Character Set only sets Macros Unicode/MBCS but not the source character set or execution character set.

提交回复
热议问题