The Problem
You left out the information about using
French output.
That will hang the Windows Console / PowerShell Console. MinGW console streams (cin, cout, cerr, and wcin, wcout, wcerr) are particularly bad at it (== totally broken). You must use the
Windows Console API to do it right.
I have written a small library (less than 200 lines of actual code) to repurpose the console streams (cin, cout, cerr) to seamlessly make (== no changes in code) Windows UTF-8 (and to fix main()’s argv[] to supply UTF-8 data), but it is not quite ready to go up on GitHub yet. If you want I can email you a working
preview version that will work with GCC or MSVC, and your problems will disappear. (PM me.)
However, for now I just recommend using MSVC and using the wcin, wcout, wcerr streams, and std::wstring class, which work just fine in MSVC.
Again, you cannot get past the problem in MinGW; the reasons run deep and are assuredly stupid in the extreme.
As a stop-gap measure: after every input/output, simply
cin.clear();
/
cout.clear();
. This keeps things from hanging, but doesn’t actually fix the underlying problem.
What Console?
Primarily
ConEmu|
https://conemu.github.io/
Also the standard
Windows Console, but I have it fairly customized. (The key is managing your PATH.)
And, when I need to compile something Linux-y,
MSYS2|
https://www.msys2.org/
Sublime
It is well-named. The authors ask $70 for it, but you can technically download it and “evaluate” it indefinitely. I prefer honesty, and will pay $70 when I have the extra funds to spend on it.
I also like
Notepad++|
https://notepad-plus-plus.org/ as a close second.
I can’t stand Atom. Or Emacs. Or Windows Notepad, LOL.