René's URL Explorer Experiment


Title: Make console windows fully UTF-8 by default on Windows, in line with the behavior on Unix-like platforms - character encoding, code page · Issue #7233 · PowerShell/PowerShell · GitHub

Open Graph Title: Make console windows fully UTF-8 by default on Windows, in line with the behavior on Unix-like platforms - character encoding, code page · Issue #7233 · PowerShell/PowerShell

X Title: Make console windows fully UTF-8 by default on Windows, in line with the behavior on Unix-like platforms - character encoding, code page · Issue #7233 · PowerShell/PowerShell

Description: PowerShell Core now commendably defaults to UTF-8 encoding, including when sending strings to external programs, as reflected in $OutputEncoding's default value. However, because the console-window shortcut file / taskbar entry still def...

Open Graph Description: PowerShell Core now commendably defaults to UTF-8 encoding, including when sending strings to external programs, as reflected in $OutputEncoding's default value. However, because the console-window...

X Description: PowerShell Core now commendably defaults to UTF-8 encoding, including when sending strings to external programs, as reflected in $OutputEncoding's default value. However, because the console-wi...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/7233

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make console windows fully UTF-8 by default on Windows, in line with the behavior on Unix-like platforms - character encoding, code page","articleBody":"PowerShell Core now commendably defaults to UTF-8 encoding, including when sending strings _to_ _external_ programs, as reflected in `$OutputEncoding`'s default value.\r\n\r\nHowever, because the console-window shortcut file / taskbar entry still defaults to the OEM code page implied by the legacy system locale (e.g. `437` on US-English systems), it misinterprets strings _from_ external programs; e.g., with Node.js installed:\r\n\r\n```powershell\r\nPSCoreOnWin\u003e $captured = '€' | node -pe \"require('fs').readFileSync(0).toString().trim()\"; $captured\r\nΓé¼    # !! node's UTF-8 output was misinterpreted.\r\n```\r\n\r\nThis currently requires the following _workaround_ (in addition to requiring the console window to use a TrueType font (true by default on Windows 10)):\r\n\r\n```powershell\r\n[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding\r\n```\r\n\r\n\u003csup\u003ePrepend `$OutputEncoding = ` to make a _Windows PowerShell_ console fully UTF-8-aware.\u003c/sup\u003e\r\n\r\nThe above implicitly switches to the UTF-8 code page (`65001`), as then reflected in `chcp`.\r\n\r\nThis obscure workaround shouldn't be necessary, and I think it would make sense for PowerShell to automatically set `[console]::InputEncoding` and `[console]::OutputEncoding` to (BOM-less) UTF-8 on startup.\r\n\r\n_Update_: When this issue was originally created, there was no mechanism for presetting code page `65001` (UTF-8) _system-wide_, which necessitated the awkward workaround. In recent versions of Windows 10 it _is_ now possible to switch to code page `65001` _as the system locale_ and therefore system-wide, although as of Windows 10 version 1909 that feature is still in _beta_ - see [this SO answer](https://stackoverflow.com/a/57134096/45375).\r\n\r\n  * _Caveat_: In addition to defaulting the _OEM_ code page to `65001` in all console windows (including `cmd.exe` windows), this invariably also makes _Windows PowerShell_'s  _ANSI_-encoding-default cmdlets default to UTF-8, notably `Get-Content` and `Set-Content`, which can be problematic from a backward-compatibility perspective. \r\nAdditionally, there is a _bug_ - [see below](https://github.com/PowerShell/PowerShell/issues/7233#issuecomment-640243647).\r\n\r\nThe change, which can also be made programmatically ([see below](https://github.com/PowerShell/PowerShell/issues/7233#issuecomment-640243647)), requires administrative privileges and a reboot.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core 7.1.0-preview.3 on Windows 10\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-07-05T18:22:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":26},"url":"https://github.com/7233/PowerShell/issues/7233"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a6d913c0-dd39-32cc-dc83-ac24891e0095
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA81A:BFC9D:8BDFA0:CC7A82:6A589AC5
html-safe-nonce7a0b3835e6e4a5b9fe2aa165e7604ffdeeba4e0af251f808984c9b28dc5df74c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODFBOkJGQzlEOjhCREZBMDpDQzdBODI6NkE1ODlBQzUiLCJ2aXNpdG9yX2lkIjoiOTA3MDIzMjU0MDE1ODY2MzM2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfb3c013be73ad93b44f1a0fa67097d59bdc209611e83539cdc1cee097fe44cc1
hovercard-subject-tagissue:338678675
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/7233/issue_layout
twitter:imagehttps://opengraph.githubassets.com/faed5b9c162fdc0c952b5f740f6183d11c0be0e4dbbd164e291a3ccf7ba411b3/PowerShell/PowerShell/issues/7233
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/faed5b9c162fdc0c952b5f740f6183d11c0be0e4dbbd164e291a3ccf7ba411b3/PowerShell/PowerShell/issues/7233
og:image:altPowerShell Core now commendably defaults to UTF-8 encoding, including when sending strings to external programs, as reflected in $OutputEncoding's default value. However, because the console-window...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemklement0
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/7233#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F7233
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F7233
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/7233
Reloadhttps://github.com/PowerShell/PowerShell/issues/7233
Reloadhttps://github.com/PowerShell/PowerShell/issues/7233
Please reload this pagehttps://github.com/PowerShell/PowerShell/issues/7233
PowerShell https://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Notifications https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Fork 8.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Star 54.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Code https://github.com/PowerShell/PowerShell
Issues 1.2k https://github.com/PowerShell/PowerShell/issues
Pull requests 291 https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality 3 https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Code https://github.com/PowerShell/PowerShell
Issues https://github.com/PowerShell/PowerShell/issues
Pull requests https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.