Subject: | Wrong code page under some (rare) condition |
Win32::Console::OutputCP() returns 0 if the function fails for some reason (eg. no console). In that case, Term::Encoding returns invalid code page "cp0".
https://docs.microsoft.com/en-us/windows/console/getconsoleoutputcp
https://docs.microsoft.com/en-us/windows/desktop/Intl/code-page-identifiers