Message383626
> Okay, and also when GetConsoleCP() fails because there's no console (e.g. python.exe w/ DETACHED_PROCESS creation flag, or pythonw.exe).
When there is no console, stdio should use the default textio encoding that is ANSI for now.
> However, using UTF-8 for the input code page is currently broken in many cases, so it should not be promoted as a recommended solution until Microsoft fixes their broken code (which should have been fixed 20 years ago; it's ridiculous). Legacy console applications rely on ReadFile and ReadConsoleA. Setting the input code page to UTF-8 is limited to reading 7-bit ASCII (ordinals 0-127). Other characters get converted to null bytes.
Regardless when we promote it, people use `chcp 65001` in cmd and `[Console]::OutputEncoding = [Text.Encoding]::UTF8` in Power Shell.
In such situation, UTF-8 is the best encoding for pipes and redirected files. |
|
Date |
User |
Action |
Args |
2020-12-23 01:22:55 | methane | set | recipients:
+ methane, paul.moore, vstinner, tim.golden, zach.ware, eryksun, steve.dower, izbyshev, u36959 |
2020-12-23 01:22:55 | methane | set | messageid: <1608686575.9.0.343159710397.issue42707@roundup.psfhosted.org> |
2020-12-23 01:22:55 | methane | link | issue42707 messages |
2020-12-23 01:22:55 | methane | create | |
|