Windows has three character encodings:
- Unicode, which is UTF16 for unicode characters
- ansi, which is a collective name for various 8-bit encodings (including utf-8 in the few places where Windows uses it)
- oem, the dos-like codepage from the console.
Constants are ansi, but you want to print OEM. The conversion function is ansitooem (which is nowadays implemented using
chartooem). CRT takes over the console and probably does this automatically (?)
Another thing to try is changing the OEM codepage from the default 850 to ancient default dos with
chcp 437
before running your program.