Skip to content

Force utf16le for wsl profile fetching#276517

Merged
Tyriar merged 2 commits intomainfrom
tyriar/276253
Nov 10, 2025
Merged

Force utf16le for wsl profile fetching#276517
Tyriar merged 2 commits intomainfrom
tyriar/276253

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Nov 10, 2025

Fixes #276253

@Tyriar Tyriar added this to the November 2025 milestone Nov 10, 2025
@Tyriar Tyriar self-assigned this Nov 10, 2025
Copilot AI review requested due to automatic review settings November 10, 2025 15:10
@Tyriar Tyriar enabled auto-merge November 10, 2025 15:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where WSL distribution detection fails when users have enabled UTF-8 mode via the WSL_UTF8 environment variable. The change ensures consistent UTF-16LE encoding by explicitly setting WSL_UTF8=0 when executing wsl.exe -l -q.

Key Changes:

  • Modified the getWslProfiles function to explicitly disable UTF-8 mode when listing WSL distributions
  • Updated comment to explain why the encoding must be forced

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tyriar Tyriar merged commit 0fa9c6a into main Nov 10, 2025
28 checks passed
@Tyriar Tyriar deleted the tyriar/276253 branch November 10, 2025 16:14
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code incorrectly assumes wsl.exe outputs UTF-16LE when the WSL_UTF8 environment variable is set

4 participants