8000 The help function breaks when [Console]::OutputEncoding is set to Unicode · Issue #5994 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
The help function breaks when [Console]::OutputEncoding is set to Unicode #5994
@ExE-Boss

Description

@ExE-Boss

Given the fact that PowerShell is moving to Unicode (see #4681, PowerShell/PowerShell-RFC#71 (comment), etc.), it might be a good idea to fix the help function for this particular case.

# Set the outputencoding to Console::OutputEncoding. More.com doesn't work well with Unicode.
$outputEncoding=[System.Console]::OutputEncoding
$help = Get-Help @PSBoundParameters

Known cases where [Console]::OutputEncoding is set to Unicode:

  • PowerShell is launched inside Visual Studio Code
  • PowerShell is launched in a non-Windows environment (even Bash on Ubuntu on Windows)
  • [Console]::OutputEncoding has been manually set to Unicode

Blocks #7233


A possible workaround is to install less for Windows and set $env:PAGER to less.exe, which supports UTF-8 properly, unlike the old more.com.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimeWG-Interactive-HelpSystemhelp infrastructure and formatting of help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0