Skip to content

Add option to enforce UTF‑8 output for Meson tasks on Windows #302

@faithysq666

Description

@faithysq666

Feature request: UTF‑8 output option for tasks

On Windows, Meson task output in VS Code often suffers from encoding issues (garbled characters, especially with non‑ASCII text). Currently, the extension launches tasks directly with meson ..., which inherits the default code page (CP936/CP1252). This causes problems when reading output containing Unicode characters.

Proposed solution:
Introduce a configuration option (e.g. "meson.useUtf8Output": true) that makes the extension wrap all ProcessExecution calls with:

cmd.exe /c chcp 65001 >NUL && meson ...

This ensures the terminal code page is switched to UTF‑8 before running Meson, so all output is consistently encoded.

Benefits:

  • Correct display of Unicode characters in output
  • Better compatibility with projects using internationalized strings
  • No need for users to manually patch the extension

Environment:

  • VS Code version: 1.106.2
  • Extension version: 1.28.0
  • OS: Windows 10/11
  • Meson version: 1.9.1

Additional context:
I tested a local modification by wrapping ProcessExecution with cmd.exe /c chcp 65001, and it solved the problem. Having this as a built‑in option would make the extension more user‑friendly for Windows developers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions