Made open method work for UTF8 paths on windows

pull/191/head
henrikbuchholz 2013-08-15 15:40:09 +02:00
parent cc3f8b82f9
commit c6a3623d16
1 changed files with 7 additions and 0 deletions

View File

@ -86,7 +86,14 @@ IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode)
ai_assert(NULL != strFile);
ai_assert(NULL != strMode);
#ifdef WIN32
wchar_t pFileW[PATHLIMIT];
DecodeUTF8(strFile, strlen(strFile), pFileW, PATHLIMIT);
FILE* file = ::_wfopen(pFileW, L"rb");
#else
FILE* file = ::fopen( strFile, strMode);
#endif
if( NULL == file)
return NULL;