Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: PowerShell not working with username having Unicode#251534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Tyriar merged 1 commit intomicrosoft:mainfromliuxingbaoyu:fix-251478
Jun 16, 2025

Conversation

liuxingbaoyu
Copy link
Contributor

Fixes#251478
On some computers, the default encoding of PowerShell is not utf8, which will cause the Unicode characters in the obtained environment variables to become garbled. Here we first set the encoding to utf8 to fix this issue.

@lszomoru
Copy link
Member

@Tyriar, could you please take a look at this fix? Thanks!

@TyriarTyriar added this to theJune 2025 milestoneJun 16, 2025
@TyriarTyriarenabled auto-mergeJune 16, 2025 19:01
@TyriarTyriar merged commit480485f intomicrosoft:mainJun 16, 2025
7 checks passed
@@ -139,7 +139,7 @@ async function doResolveShellEnv(logService: ILogService, token: CancellationTok
// Older versions of PowerShell removes double quotes sometimes
// so we use "double single quotes" which is how you escape single
// quotes inside of a single quoted string.
command = `Write-Output '${mark}'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output '${mark}'`;
command = `chcp 65001;Write-Output '${mark}'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output '${mark}'`;

Choose a reason for hiding this comment

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

...wait does this run on macOS & Linux as well with PowerShell 7+? If sochcp is not available there and this will break.

Copy link
ContributorAuthor

@liuxingbaoyuliuxingbaoyuJun 16, 2025
edited
Loading

Choose a reason for hiding this comment

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

Oops, I testedchcp and it doesn't work on linux.
I noticed@Tyriar already fixed it, thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@TylerLeonhardtTylerLeonhardtTylerLeonhardt approved these changes

@TyriarTyriarTyriar approved these changes

Assignees

@lszomorulszomoru

Labels
None yet
Projects
None yet
Milestone
June 2025
Development

Successfully merging this pull request may close these issues.

VS Code has operational problems when you have an user folder with special characters.
4 participants
@liuxingbaoyu@lszomoru@Tyriar@TylerLeonhardt

[8]ページ先頭

©2009-2025 Movatter.jp