[Mingw-users] How to pass path with non-ASCII characters to std::ifstream on Windows?

Back to archive index
Vadim Peretokin vpere****@gmail*****
Sat Jul 13 14:15:18 JST 2019


I need to get Hunspell to open a file with non-ASCII characters on
Windows and as such I need to patch its myopen function
(https://github.com/hunspell/hunspell/blob/v1.6.2/src/hunspell/csutil.cxx#L123)
which takes in a std::ifstream& stream, const char* path.

As you can see from the link included, hunspell already includes a
workaround for MSVC that uses std::ifstream<char>::open with wchar_t
file names, but unfortunately this function is not available in MinGW
per MinGW wiki.

What can I do to make this work with MinGW? I see that patches to
MinGW have been posted in the past, but using MinGW 7.3.0, I can't get
anything to work.

I've been breaking my head over this for the last three days and would
love any advice on how to get past this.

Thank you!



More information about the MinGW-Users mailing list
Back to archive index