GHC fails to execute gcc on Windows when unicode character is in the path
This happens when the location of gcc is under a path with non-ASCII directory in it:
PS C:\Users\日\stack-test> & 'C:\Users\日\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.exe' -no-user-package-db .\Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
<no location info>: error:
Warning: Couldn't figure out C compiler information!
Make sure you're using GNU gcc, or clang
Unable to start C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin/realgcc.exe (error code: 123)
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)
Tested with ghc 8.0.2 on Windows Server 2016 with the system locale set to English (US)
(same setup as in #15021 (closed), see there for how to set the locale).
This was discovered as part of the effort to make Haskell tooling work well for users with non-ASCII user names: https://github.com/commercialhaskell/stack/issues/3988