Can I open a file with C functions (fopen) and assign that handle to a C++ file stream (fstream...)?
Reason for asking: I want to handle UTF8 on windows but the fstream class has only a const char* ctor/open method. So I need to open it using the C API and then make a stream object use it.
It might even be possible with the boost stream library as it often allows specifying your own sinks/sources but I don't know where to start.
Clarification: I want to open a file with a path given as an UTF8 string. So the file open method must support UTF8 paths which fstream does not. The MSVC extension accepting a const wchar_t* does help, but MinGW does not provide these overloads. So I'd need to use wfopen on windows instead.