https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108865
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Costas Argyris from comment #2) > (In reply to Andrew Pinski from comment #1) > > Utf8 is the best generic solution really. > > Using wmain is not very portable and the rest of gcc's sources can't use > > wchar_t as that would break unix/Linux handling. > > Yes, on that, I was thinking to only use wchar_t in wmain just to get the > arguments properly (not destroyed), and immediately convert to UTF-8 char > arrays to pass to the rest of the program (starting with the call to > driver.main which main wraps). That way, all sources would stay the same > working with char arrays, only this time it would be UTF-8 char arrays that > properly carry the Unicode args. This would allow only selected parts of > the Windows-specific code (possibly only in libiberty/pex-win32.c) to opt-in > for the necessary conversion back to wchar_t UTF-16 arrays in order to call > the Unicode versions of Win32 APIs like CreateProcessW etc., and get > end-to-end Unicode support on Windows. I think that is bad solution in general. Just use utf8 like every other target would.