diff options
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/msvc_utf8.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/markdown/snippets/msvc_utf8.md b/docs/markdown/snippets/msvc_utf8.md new file mode 100644 index 0000000..fb8763d --- /dev/null +++ b/docs/markdown/snippets/msvc_utf8.md @@ -0,0 +1,16 @@ +## MSVC compiler now assumes UTF-8 source code by default + +Every project that uses UTF-8 source files had to add manually `/utf-8` C/C++ +compiler argument for MSVC otherwise they wouldn't work on non-English locale. +Meson now switched the default to UTF-8 to be more consistent with all other +compilers. + +This can be overridden but using `/source-charset`: +```meson +if cc.get_id() == 'msvc' + add_project_arguments('/source-charset:.XYZ', language: ['c', 'cpp']) +endif +``` + +See Microsoft documentation for details: +https://docs.microsoft.com/en-us/cpp/build/reference/source-charset-set-source-character-set. |