This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, ezio.melotti, john_miller, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-09-20.22:05:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600639516.63.0.800789316338.issue41821@roundup.psfhosted.org>
In-reply-to
Content
> It is set to use an OEM raster font.

Okay, then the issue can either be closed as third-party or changed to a documentation enhancement. It could be documented that Unicode support requires selecting a TrueType font in the console properties. "Raster Fonts" uses OEM with a lossy best-fit conversion (e.g. "α" -> "a").  

> So I assume that with the UTF-8 flag set the font still has to be 
> set to a TTF-Font so it does not beep?

Yes, the conversion to OEM for "Raster Fonts" occurs in the console itself. 

> I CP850 required to encode those characters via CP850 to the 
> bell character?

Other OEM codepages have a different best-fit mapping. For example, codepage 437 maps U+2022 to ASCII bell, but not U+2024 or U+2219.

> I was a bit lost on what happens under the hood encoding-wise as 
> sys.stdout.encoding just returns 'utf-8'.

For a console file, the io module uses io._WindowsConsoleIO for the raw layer instead of io.FileIO. _WindowsConsoleIO internally uses the console's wide-character (UTF-16) API and converts to and from UTF-8. 

Overriding the standard I/O encoding to UTF-8 isn't needed for _WindowsConsoleIO. It's needed for regular files and pipes when standard I/O is redirected, since those still default to the process active codepage (usually system ANSI).
History
Date User Action Args
2020-09-20 22:05:16eryksunsetrecipients: + eryksun, paul.moore, tim.golden, ezio.melotti, zach.ware, steve.dower, john_miller
2020-09-20 22:05:16eryksunsetmessageid: <1600639516.63.0.800789316338.issue41821@roundup.psfhosted.org>
2020-09-20 22:05:16eryksunlinkissue41821 messages
2020-09-20 22:05:16eryksuncreate