microsoft / microsoft/vscode-cmake-tools

Encoding of rules.ninja is wrong with Visual Studio 2022.

Open
#2,741 1 comment 0 reactions 0 assignees View on GitHub
bug Feature: configure world ready
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

When I run `CMake: Configure` using CMake Tools, rules.ninja file is output as utf-8, but the character encoding is shift-jis, so it does not build correctly by ninja.

In Windows 10 Japanese Edition, the standard encoding of the command prompt is shift-jis, so usually I would run `chcp 65001` before running cmake configure.
But CMake Tools does not have a setting to specify the encoding before the running configure.

`"cmake.outputLogEncoding": "utf-8"` does not fix this problem.

I also try to use Terminal Profiles, but I could not solve the problem.
https://code.visualstudio.com/docs/terminal/profiles

This problem not happened, when I used Visual Studio 2019.

### CMake Tools Diagnostics

_No response_

### Debug Log

_No response_

### Additional Information

shif-jis code in rules.ninja.
> msvc_deps_prefix = ����: �C���N���[�h �t�@�C��:

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by running CMake: Configure on Windows 10 Japanese Edition with Visual Studio 2022, then inspect the generated rules.ninja encoding and compare it with Visual Studio 2019. Review how cmake.outputLogEncoding and terminal profiles affect configuration, and consider the work complete when rules.ninja is readable by ninja and the project builds correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.