All filesystems supported by Windows since Windows XP do save the name of the files and folders in Unicode format. Regardless of this, both fopen
and std::*fstream
are strictly unable to open files when given UTF-8 strings containing non-ASCII characters in all current Windows version. Trying to do so will fail.
Solutions for cross-platform development:
- Windows 10 version 1803 and up only: Override the locale in the context of the application to set it to UTF-8 (see Microsoft's documentation about setlocale())
- Use Boost::nowide.