PowerShell / PowerShell/Win32-OpenSSH

Wrong locale settings used for error hints

Open
#2,120 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Investigate
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce
  1. use non-English as the default display language, e.g. Simplified Chinese,
  2. enable experimental UTF-8 support, or use command chcp 65001 to enable it for tests
  3. run ssh with a wrong remote address, e.g. ssh pi@raspberrypi4.locax
  4. then the error hints will be printed as UTF-8 hexademical values, instead of readable text in Chinese or other languags.

P.S. Expected behaviour is demostrated by SSH from msys2.

Expected behavior
PS C:\Users\stephen> chcp
Active code page: 65001
PS C:\Users\stephen> C:\Users\stephen\workspace0\dev\msys2\usr\bin\ssh.exe pi@raspberrypi4.locax
ssh: Could not resolve hostname raspberrypi4.locax: Name or service not known
Actual behavior
PS C:\Users\stephen> chcp
Active code page: 65001
PS C:\Users\stephen> ssh pi@raspberrypi4.locax
ssh: Could not resolve hostname raspberrypi4.locax: \344\270\215\347\237\245\351\201\223\350\277\231\346\240\267\347\232\204\344\270\273\346\234\272\343\200\202
Error details
No Errors occurred.
Environment data
PS C:\Users\stephen> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.25393
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

OpenSSH_for_Windows_9.2p1, LibreSSL 3.6.2

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported ssh command with a non-English display language and code page 65001, then trace the error-hint path involved in UTF-8 output on Windows. Done means the wrong-hostname case prints readable localized text rather than escaped UTF-8 hexadecimal values, with regression coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
internationalization, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.