libs/yocto/yocto_commonio.cpp
// Opens a file with a utf8 file name
Opens a file with a utf8 file name
Opens a file with a utf8 file name
FILE* fopen_utf8(const char* filename, const char* mode) {
#ifdef _WIN32
  auto path8 = std::filesystem::u8path(filename);
  auto wmode = std::wstring(string{mode}.begin(), string{mode}.end());
  return _wfopen(path8.c_str(), wmode.c_str());
#else
  return fopen(filename, mode);
#endif
}
FILE * fopen_utf8 ( const char * filename , const char * mode ) { #ifdef _WIN32 auto path8 = std :: filesystem :: u8path ( filename ) ; auto wmode = std :: wstring ( string { mode } . begin ( ) , string { mode } . end ( ) ) ; return _wfopen ( path8 . c_str ( ) , wmode . c_str ( ) ) ; #else return fopen ( filename , mode ) ; #endif }
Opens a file with a utf8 file name
Opens a file with a utf8 file name