Title: [Console]::OutputEncoding doesn't work to parse exe with unicode output · Issue #10789 · PowerShell/PowerShell · GitHub
Open Graph Title: [Console]::OutputEncoding doesn't work to parse exe with unicode output · Issue #10789 · PowerShell/PowerShell
X Title: [Console]::OutputEncoding doesn't work to parse exe with unicode output · Issue #10789 · PowerShell/PowerShell
Description: Steps to reproduce I have a Windows executable that produces unicode (utf-16) output. In PowerShell 5.1, I can set the [Console]::OutputEncoding property so the output of that command gets correctly interpreted. On PowerShell Core 6.2.3,...
Open Graph Description: Steps to reproduce I have a Windows executable that produces unicode (utf-16) output. In PowerShell 5.1, I can set the [Console]::OutputEncoding property so the output of that command gets correctl...
X Description: Steps to reproduce I have a Windows executable that produces unicode (utf-16) output. In PowerShell 5.1, I can set the [Console]::OutputEncoding property so the output of that command gets correctl...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10789
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Console]::OutputEncoding doesn't work to parse exe with unicode output","articleBody":"# Steps to reproduce\r\nI have a Windows executable that produces unicode (utf-16) output. In PowerShell 5.1, I can set the [Console]::OutputEncoding property so the output of that command gets correctly interpreted. On PowerShell Core 6.2.3, that doesn't appear to work.\r\n\r\nI've also tried setting [Console]::InputEncoding and $OutputEncoding, but the problem persists.\r\n\r\nFor example, I use the wsl.exe binary here, so this should repro on any system that has the Windows Subsystem for Linux installed.\r\n\r\n```powershell\r\n[Console]::OutputEncoding = [System.Text.Encoding]::Unicode\r\nwsl.exe --list -v | ForEach-Object { $_ }\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\nPS C:\\Users\\svgroot> [Console]::OutputEncoding = [System.Text.Encoding]::Unicode\r\nPS C:\\Users\\svgroot> wsl.exe --list -v | ForEach-Object { $_ }\r\n NAME STATE VERSION\r\n* Ubuntu Stopped 2\r\n Ubuntu-18.04 Stopped 2\r\n Alpine Stopped 1\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nPS C:\\Users\\svgroot> [Console]::OutputEncoding = [System.Text.Encoding]::Unicode\r\nPS C:\\Users\\svgroot> wsl.exe --list -v | ForEach-Object { $_ }\r\n N A M E S T A T E V E R S I O N\r\n\r\n * U b u n t u S t o p p e d 2\r\n\r\n U b u n t u - 1 8 . 0 4 S t o p p e d 2\r\n\r\n A l p i n e S t o p p e d 1\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.3\r\nPSEdition Core\r\nGitCommitId 6.2.3\r\nOS Microsoft Windows 10.0.19001\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/SvenGroot","@type":"Person","name":"SvenGroot"},"datePublished":"2019-10-14T19:13:37Z","url":"https://github.com/PowerShell/PowerShell/issues/10789"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5ff721f6-e349-88ac-859b-9f89146f148b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82CA:2B4DE7:BE480:10BECF:6AFD4B33 |
| html-safe-nonce | 0a60c31e0c322edcaabe357c739842db75e478488a4036ff5d19c7f2b183aede |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkNBOjJCNERFNzpCRTQ4MDoxMEJFQ0Y6NkFGRDRCMzMiLCJ2aXNpdG9yX2lkIjoiMTcyNzA1Mzk1NTkwOTA4NzIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a5ed43603a0ab5e816ade1646178a7bf87a019e22470bc856042774f4aad9a7 |
| hovercard-subject-tag | issue:506827324 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/10789/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4a892fae5949d312f94ee6116ecf5f68d2015941eb725dd30cd66bd301e1e996/PowerShell/PowerShell/issues/10789 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4a892fae5949d312f94ee6116ecf5f68d2015941eb725dd30cd66bd301e1e996/PowerShell/PowerShell/issues/10789 |
| og:image:alt | Steps to reproduce I have a Windows executable that produces unicode (utf-16) output. In PowerShell 5.1, I can set the [Console]::OutputEncoding property so the output of that command gets correctl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SvenGroot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width