I'm currently writing a small C program, using MinGW's gcc to compile it on Windows. I'm also hosting it on GitHub (and using GitHub Desktop for Windows). GitHub, however, appears to enforce UTF-8 encoding in the files and the Windows Terminal have trouble dealing with UTF-8.
After some searching I found a few solutions, but they require manual, end-user style solutions, which I want to avoid (I'm not planning on distributing it or anything, but I wonder what I would do if I was).
What currently works is changing the encoding to ANSI and manually fixing everything before compilation, but I would rather avoid having to do that every damn time I want to work on Windows.
So the question is: How to handle UTF-8 encoded source when compiling on Windows?
Here's some sample output:
[]
- Left: Source Code encoded in UTF-8 (displayed wrong).
- Right: Source code encoded in ANSI (displayed right).
Compilation process is exactly the same, only difference is the actual source-code encoding.