I think there is a shortcut to allow wcout to be handled wcout on Windows. Try adding this as the first line to your main :
_setmode(_fileno(stdout), _O_U16TEXT);
After that wcout << L" (2)!" << endl; wcout << L" (2)!" << endl; will work like a charm regardless of the current locale and single-byte encoding selected by the user (as it should be).
source share