0025367: IGES and BRep persistence - support unicode file names on Windows
[occt.git] / src / Message / Message_MsgFile.cxx
index 1dbf2f8..735182c 100644 (file)
@@ -20,6 +20,7 @@
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <Standard_Mutex.hxx>
+#include <OSD_OpenFile.hxx>
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -214,13 +215,7 @@ Standard_Boolean Message_MsgFile::LoadFile (const Standard_CString theFileName)
   if (theFileName == NULL || * theFileName == '\0') return Standard_False;
 
   //    Open the file
-#ifdef _WIN32
-  // file name is treated as UTF-8 string
-  TCollection_ExtendedString aFileNameW(theFileName, Standard_True);
-  FILE *anMsgFile = _wfopen ((const wchar_t*)aFileNameW.ToExtString(), L"rb");
-#else
-  FILE *anMsgFile = fopen (theFileName, "rb");
-#endif
+  FILE *anMsgFile = OSD_OpenFile(theFileName,"rb");
   if (!anMsgFile) return Standard_False;
 
   //    Read the file into memory