Commit dd73ed45 authored by Marian Durkovic's avatar Marian Durkovic

Support for non-ANSI filenames on Win32

parent 90db07cf
......@@ -611,6 +611,25 @@ static int _OpenFile( access_t * p_access, const char * psz_name )
p_access->info.i_update |= INPUT_UPDATE_SIZE;
fseek( p_sys->fd, 0, SEEK_SET );
#else
#if defined (WIN32)
if( GetVersion() < 0x80000000 )
{
/* for Windows NT and above */
wchar_t wpath[MAX_PATH + 1];
if( !MultiByteToWideChar( CP_UTF8, 0, psz_name, -1, wpath, MAX_PATH ) )
{
msg_Err( p_access, "incorrect file name %s", psz_name );
return VLC_EGENERIC;
}
wpath[MAX_PATH] = L'\0';
p_sys->fd = _wopen( wpath, O_NONBLOCK );
goto opencont;
}
#endif
const char *psz_localname = ToLocale( psz_name );
if( psz_localname == NULL )
{
......@@ -618,10 +637,10 @@ static int _OpenFile( access_t * p_access, const char * psz_name )
return VLC_EGENERIC;
}
// FIXME: support non-ANSI filenames on Win32
p_sys->fd = open( psz_localname, O_NONBLOCK /*| O_LARGEFILE*/ );
LocaleFree( psz_localname );
opencont:
if ( p_sys->fd == -1 )
{
msg_Err( p_access, "cannot open file %s (%s)", psz_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment