Crap - a fork of poop with macos support

Run chcp 65001 to change the code page to UTF-8. If you want to do that automatically when your program runs, you can do:

    if (builtin.os.tag == .windows) {
        _ = std.os.windows.kernel32.SetConsoleOutputCP(65001);
    }

(but note that the new code page persists past the program exiting)

I have an old branch with Windows support if it’s helpful at all. I think the only relevant thing might be the console size getting code:

        .windows => {
            var info: std.os.windows.CONSOLE_SCREEN_BUFFER_INFO = undefined;
            if (std.os.windows.kernel32.GetConsoleScreenBufferInfo(stdout, &info) != std.os.windows.TRUE) {
                return 80;
            }
            return @intCast(info.dwSize.X);
        },
4 Likes