diff --git a/desmume/src/ROMReader.cpp b/desmume/src/ROMReader.cpp index fa11de356..4e7a6a806 100644 --- a/desmume/src/ROMReader.cpp +++ b/desmume/src/ROMReader.cpp @@ -87,8 +87,13 @@ void* STDROMReaderInit(const char* filename) if ((sb.st_mode & S_IFMT) != S_IFREG) return 0; #endif - + +#ifdef WIN32 FILE* inf = _wfopen(mbstowcs((std::string)filename).c_str(),L"rb"); +#else + FILE* inf = fopen(filename, "rb"); +#endif + if(!inf) return NULL; STDROMReaderData* ret = new STDROMReaderData(); @@ -366,4 +371,4 @@ ROMReader_struct * MemROMReaderRead_TrueInit(void* buf, int length) mem.len = length; mem.pos = 0; return &MemROMReader; -} \ No newline at end of file +}