-// Copyright (C) 2007-2019 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
#include "VTKViewer_OpenGLHelper.h"
+#include <Basics_Utils.hxx>
#ifndef WIN32
# ifndef GLX_GLXEXT_LEGACY
{
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;
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 );