microsoft / microsoft/vscode-cmake-tools
Incorrect Encoding for CMake Output in VSCode Terminal on Chinese Windows System
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Brief Issue Summary
## Bug Description
I am using CMake with MSVC to build a C++ program on my Chinese Windows system. With the default settings of CMake Tools, the output displayed in the VSCode terminal has incorrect encoding. Please see the highlighted section in the screenshot below.

## Possible Fix
The default setting for `cmake.outputLogEncoding` is "auto" (related patch: https://github.com/microsoft/vscode-cmake-tools/pull/550). This setting sets the interpreted encoding of CMake output to the ANSI encoding on Windows, which in my case is GBK (cp936).
However, when I set `cmake.outputLogEncoding` to "utf-8", the output displays correctly, so I suspect that the actual encoding of the CMake output is UTF-8. I believe changing the default setting of `cmake.outputLogEncoding` to "utf-8" could resolve this bug.
## How to Reproduce
I believe that building any CMake project on a non-ASCII Windows system will reproduce this problem.
## Related Issues
https://github.com/microsoft/vscode-cmake-tools/issues/3632
### CMake Tools Diagnostics
```shell
```
### Debug Log
```shell
```
### Additional Information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cmake.outputLogEncoding setting and the related patch in pull request #550. Reproduce a CMake/MSVC build on a Chinese Windows system, compare the default and utf-8 settings in the VSCode terminal, and verify that the corrected default displays output properly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100