Salome HOME
updated copyright message
[modules/gui.git] / src / VTKViewer / VTKViewer_OpenGLHelper.cxx
index d299db78ea6ef3469bfbef140ae12689f36dd16c..122376bbce8b57598d1f17bddd45eada83a24458 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -22,6 +22,7 @@
 
 
 #include "VTKViewer_OpenGLHelper.h"
+#include <Basics_Utils.hxx>
 
 #ifndef WIN32
 # ifndef GLX_GLXEXT_LEGACY
@@ -219,8 +220,12 @@ namespace GUI_OPENGL
 {
        char* readFromFile( std::string fileName )
        {
+#if defined(WIN32) && defined(UNICODE)
+         const wchar_t* wFileName = Kernel_Utils::utf8_decode( fileName.c_str() );
+         FILE* file = _wfopen( wFileName, L"r" );
+#else
          FILE* file = fopen( fileName.c_str(), "r" );
-
+#endif
          char* content = NULL;
          int count = 0;
 
@@ -233,7 +238,7 @@ namespace GUI_OPENGL
                if( count > 0 )
                {
                  content = ( char* )malloc( sizeof( char ) * ( count + 1 ) );
-                 count = fread( content, sizeof( char ), count, file );
+                 count = (int)fread( content, sizeof( char ), count, file ); //!< TODO: conversion from size_t to int
                  content[ count ] = '\0';
                }
                fclose( file );