# Module std.compat is not compiled with UTF8

**URL:** <https://discourse.cmake.org/t/module-std-compat-is-not-compiled-with-utf8/11764>\
**Category:** Code\
**Created:** [September 25, 2024, 9:33am UTC](https://discourse.cmake.org/t/module-std-compat-is-not-compiled-with-utf8/11764 "2024-09-25T09:33:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuliusCaesar](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Post date:** [September 25, 2024, 9:33am UTC](https://discourse.cmake.org/t/module-std-compat-is-not-compiled-with-utf8/11764/1 "2024-09-25T09:33:35Z")

</div>

Hey guys, I have been trying to work with import.std using [this blogpost](https://www.kitware.com/import-std-in-cmake-3-30/) with latest MSVC17  
For most files this works fine, however some headers cause an MSVC warning.  
`"Warning incompatilbe environment when importing module: "std.compat": _UTF8 is defined in current command line and not in module command line`  
My files are encoded as UTF8.  
When I’m understanding this error message correctly the imported module (in my case import std.compat) is not compiled with UTF8

=\> so 1) is this a bug. if so, I’ll report it at the bugtracker 😉  
2) can I somehow tell cmake to build the std modules with utf8 as well?

thx for your help 🙂

Edit: My Compiler Invocation looks like this  
`Hostx64\x64\cl.exe /nologo /TP -DFMT_SHARED -DCMAKE_INTDIR=\"Debug\" -Ixxxx -external:W0 /DWIN32 /D_WINDOWS /EHsc /MP /bigobj /EHsc /Zc: __cplusplus /w15038 /MP /bigobj /EHsc /Zc:__ cplusplus /w15038 /Ob0 /Od /RTC1 -std:c++latest -MDd -ZI /WX /wd4702 /utf-8 - MyFile.cpp`

as you can see there is a /utf-8 flag passed to the command line (although this is somehow set by cmake. We are not setting this explictly)
