in reply to Re: Win32 encoding conversion mystery
in thread Win32 encoding conversion mystery

Thank you!

You provided both the correct answer, which is that i needed to encode the UTF8 string i got to code page 437, and provided it in massive detail. This was the exact chain i need to get useful modern UTF8. :D

my $safe = Encode::FB_CROAK | Encode::LEAVE_SRC; my $text = decode 'cp932', (encode "cp".Win32::GetOEMCP(), $windows_wi +de_filename, $safe), $safe;

Replies are listed 'Best First'.
Re^3: Win32 encoding conversion mystery
by ikegami (Patriarch) on Aug 15, 2018 at 23:09 UTC

    The actual code page you want is probably the one returned by "cp".Win32::GetOEMCP() or "cp".Win32::GetConsoleOutputCP(), not cp437. It's cp850 on my machine, for example. I think it's because I'm using "English (Canada)" instead of "English (US)".

      Thanks for the additional info, that is useful. I amended the post.