Skip to content

Get-Help, chcp, and encoding issue #1319

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Halkcyon opened this issue May 12, 2018 · 3 comments
Closed

Get-Help, chcp, and encoding issue #1319

Halkcyon opened this issue May 12, 2018 · 3 comments

Comments

@Halkcyon
Copy link

Halkcyon commented May 12, 2018

System Details

  • Operating system name and version: Windows 10 Pro 10.0.16299
PS C:\> code -v

1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
x64

PS C:\> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      7      0      0

PS C:\> code --list-extensions --show-versions

christian-kohler.npm-intellisense@1.3.0
christian-kohler.path-intellisense@1.4.2
DavidAnson.vscode-markdownlint@0.15.0
dbaeumer.vscode-eslint@1.4.8
DotJoshJohnson.xml@1.9.2
ecmel.vscode-html-css@0.2.0
eg2.tslint@1.0.28
eg2.vscode-npm-script@0.3.4
formulahendry.auto-close-tag@0.5.6
HookyQR.beautify@1.3.0
humao.rest-client@0.18.4
James-Yu.latex-workshop@5.3.3
ms-mssql.mssql@1.3.1
ms-python.python@2018.4.0
ms-vscode.csharp@1.15.1
ms-vscode.PowerShell@1.7.0
msjsdiag.debugger-for-chrome@4.4.3
PeterJausovec.vscode-docker@0.0.26
robertohuertasm.vscode-icons@7.23.0
robinbentley.sass-indented@1.4.9
shinnn.stylelint@0.36.0
vsmobile.vscode-react-native@0.6.9
Zignd.html-css-class-completion@1.17.1

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.431
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.431
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When changing the console codepage utilizing [Console]::OutputEncoding, $OutputEncoding, or chcp.com to support unicode (codepage 65001) in the integrated console from my default codepage of 437, Get-Help breaks. All output is rendered improperly (powershell.exe is unaffected by these changes). If I try to use the More utility, it actually crashes.

PS C:\> Get-Help -Name Get-Help
翿 噀❩Ǖ ❩Ǖ   2    䈜꥿ᾐကŐ❩Ǖ Ő❩Ǖ
䈱蕾ᾉ ̰❪Ǖ 燎❩Ǖ ® ® ® ® ® ® ® ❩Ǖ                                     -ⴀᾙ ̰❪Ǖ ❩Ǖ                                   ╗
Ȁᾂ ❩Ǖ Ő❩Ǖ     ║Ёᾀሀ"C:\Windows\system32\more.com"      ═؀ᾋ ❩Ǖ ❩Ǖ ❩Ǖ               ╗Ȁᾗ ❩Ǖ Ő❩Ǖ     ╚ȁᾍ᐀/ECPSH?ecpsh? ᾑ ð❩Ǖ
                                                                                                                            ఀ
̰❪Ǖ ❩Ǖ ows\system32\more.com"      ܀ᾖ ̰❪Ǖ ❩Ǖ ®         ╝Ѐᾐ ̰❪Ǖ ❩Ǖ ❩Ǖ               䊇㩷ᾤက顀❩Ǖ ❩Ǖ
                                                                                                       타士杗     ❩Ǖ  ＀��
㜅ሖ 耀                                    㜘ማĀ耀                                    㜓ሜȀ耀                                    㜖ሁ̀
耀                                    㜩ሊЀ耀                                    㜬ሏԀ耀                                    㜧ሰ؀耀
㜺ስ܀耀                                    㜽ሾࠀ耀                                    㜰ሣऀ耀                                    㝋ሤ਀耀                                    㝎ሩ଀耀                                    㝁ቒఀ耀                                    㝄቗ഀ耀
㝟ቘ฀耀                                    㝒ቝༀ耀C:\Windows\system32\more.com        㝕ቆက耀                                    㝨ቋ
ᄀ耀                                    㝣ቌሀ耀                                    㝦ቱጀ耀                                    㝹ቺ᐀
㝼ቿᔀ耀                                    㝷በᘀ耀                                    㞊ብᜀ耀
䈗ꉿἒ਀
        䈐ꑾᾂ ❩Ǖ ❩Ǖ
퀨琢翿 婀❩Ǖ ❩Ǖ    Ą    ╗  ╔ ╝ ╚       䊇㩷ᾅက颀❩Ǖ ❩Ǖ
                                                       타卫杇     ﭐ❩Ǖ ʀ쇽��        㞽ሖ 耀                            㞱ሚĀ耀
㞵ሞȀ耀                            㟉ሂ̀耀                            㟍ሆЀ耀                            㟁ሊԀ耀
㟅ሎ؀耀                            㟙ሲ܀退큀琢翿 夐❩Ǖ 鶐❩Ǖ ╔   鶐❩Ǖ ╗       㟝ሶࠀ耀                            㟑ሺऀ退偐?翶 夐❩Ǖ ❩Ǖ
❩Ǖ        㟕ሾ਀耀                            㟩ሢ଀耀                            㟭ሦఀ耀                            㟡ሪഀ耀
㟥ሮ฀耀                            㟹ቒༀ耀                            㟽ቖက退큀琢翿 夐❩Ǖ 鲀❩Ǖ ╚   鲀❩Ǖ ╝       㟱ቚᄀ耀            ╝
ð❩Ǖ ð❩Ǖ `❩Ǖ 㟵቞ዕ退큀琢翿 夐❩Ǖ 鼠❩Ǖ ╚   鼠❩Ǖ ╝       ࠉቂጀ退큀琢翿 夐❩Ǖ 龀❩Ǖ ╚   龀❩Ǖ ╝       ࠍቆ᐀退倐?翶 嚀❩Ǖ 鲐❩Ǖ ═   鲐❩Ǖ        ࠁቊᔀ退큀琢翿 夐❩Ǖ 鷐❩Ǖ ╚   鷐❩Ǖ ╝       ࠅ቎ᘀ退큀琢翿 夐❩Ǖ 鰀❩Ǖ ╚   鰀❩Ǖ ╝       ࠙ቲᜀ退偐?翶 夐❩Ǖ 鵀❩Ǖ ╗   鵀❩Ǖ ╚       ࠝቶ᠀退偐?翶 夐❩Ǖ
❩Ǖ �   ❩Ǖ �       ࠑቺᤀ耀                            ࠕቾᨀ耀                            ࠩቢᬀ耀                            ࠭ቦᰀ耀
ࠡቪᴀ耀                                                            䋌硾ἒ Ő❩Ǖ ❩Ǖ
䈂띿Ὓð❩Ǖ ð❩Ǖ `❩Ǖ `❩Ǖ က❪-- More  --

Attached Logs

logs.zip

@rjmholt
Copy link
Contributor

rjmholt commented May 17, 2018

Thanks for the report @TheIncorrigible1, this looks like another symptom of an encoding problem we've been meaning to look into in either the PowerShell host or the messaging layer.

I'm not aware of any workaround at the moment, but we'll look into it.

@BjornNordblom
Copy link

Unable to reproduce on Win 10. VSCode 1.44.1. PS extension 2020.3.0.

Steps/tests taken:

chcp 65001

$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

Get-Help gci

Showed normal output both for integrated powershell of version 5.1.18362.628 and 7.0.0.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 15, 2020
@Halkcyon
Copy link
Author

@BjornNordblom Thanks for the follow-up. After two years, significant changes have happened with the vscode terminal, but also this extension. I am also unable to recreate my steps above, but more.com still does not play nice with encodings being changed (though that's due to a bug with that particular application).

@SydneyhSmith SydneyhSmith added Community-Help and removed Needs: Maintainer Attention Maintainer attention needed! labels Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants