Cannot find std.os.windows.kernel32.SetConsoleOutputCP API to fix console garbled text issue

Any bindings that previously existed in the standard library can be placed in your project directly and they’ll work just the same. For SetConsoleOutputCP, sticking this in your project will work just fine:

extern "kernel32" fn SetConsoleOutputCP(wCodePageID: std.os.windows.UINT) callconv(.winapi) std.os.windows.BOOL;

(my personal preference is handwriting bindings for Windows APIs I need (based on the Win32 docs), but you can also check out zigwin32 if you want something more complete and auto-generated)

12 Likes