<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64668>64668</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Failed to compile llvm on a windows machine with Chinese Language #build-problem
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          RichardUSTC
      </td>
    </tr>
</table>

<pre>
    Hello,
I was compiling llvm on a Windows machine with Visual Studio. The system language is Simplified Chinese and thus the default code page is 936. 

During the compiling process, I encountered some warning and error messages as follows:
```
clang\lib\Lex\UnicodeCharSets.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 clang\lib\Lex\Lexer.cpp) [tools\clang\lib\Lex\obj.clangLex.vcxproj]
  RewriteRule.cpp
  ChromiumCheckModel.cpp
clang\lib\Lex\UnicodeCharSets.h(394,1): error C2226: 语法错误: 意外的“llvm::sys::UnicodeCharRange”类型 (编译源文件 clang\lib\Lex\Lexer.cpp) [tools\clang\lib\Lex\obj.clangLex.vcxproj]
clang\lib\Lex\UnicodeCharSets.h(394,69): error C2143: 语法错误: 缺少“;”(在“{”的前面) (编译源文件 clang\lib\Lex\Lexer.cpp) [tools\clang\lib\Lex\obj.clangLex.vcxproj]
  SourceCode.cpp
clang\lib\Lex\UnicodeCharSets.h(394,69): error C2447: “{”: 缺少函数标题(是否是老式的形式表?) (编译源文件 clang\lib\Lex\Lexer.cpp) [tools\clang\lib\Lex\obj.clangLex.vcxproj]
```

In a word, the compiler was complaining that the source file cannot represent some unicode charaters in code page 936.

I finally fixed the problem by adding `-DCMAKE_C_FLAGS="/utf-8" -DCMAKE_CXX_FLAGS="/utf-8"` to the cmake command line.
I hope that you can add the '/utf-8' flags directly in the CMakeLists.txt by default.
</pre>
<img width="1px" height="1px" alt="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