|
On 13/07/2020 02:59, Scott Morgan wrote:
On 12/07/2020 21:04, Milind Gupta wrote:How can I emulate the python encode function? Why does that work on the windows cmd and utf8.codepoint does not?tl;dr CMD.EXE isn't fully UTF8 compliant. No idea what tricks Python is pulling (recoding from a local codepage? Possible if you didn't chcp 65001 first)
BTW, in the previous SO link i posted there is a link to Python docs which apparently answers your "what tricks Python is pulling" question:
https://www.python.org/dev/peps/pep-0528/
AFAIK, this is the last word on the issue: https://devblogs.microsoft.com/commandline/windows-command-line-unicode-and-utf-8-output-text-buffer/The current changes also don’t cover what is required for our “processed input mode” that presents an editable input line for applications like CMD.exe.