p_access->info.i_update |= INPUT_UPDATE_SIZE;
fseek( p_sys->fd, 0, SEEK_SET );
#else
- int fd = -1;
-
-# if defined (WIN32)
- if (GetVersion() < 0x80000000)
- {
- /* for Windows NT and above */
- wchar_t wpath[MAX_PATH + 1];
- if (!MultiByteToWideChar (CP_UTF8, 0, path, -1, wpath, MAX_PATH))
- {
- msg_Err (p_access, "incorrect file name %s", psz_name);
- return VLC_EGENERIC;
- }
- wpath[MAX_PATH] = L'\0';
- fd = _wopen( wpath, O_NONBLOCK );
- }
- else
-# endif
- {
- const char *psz_localname = ToLocale (path);
- if (psz_localname == NULL)
- {
- msg_Err (p_access, "incorrect file name %s", psz_name);
- free (path);
- return -1;
- }
-
- fd = open (path, O_NONBLOCK /*| O_LARGEFILE*/);
- LocaleFree (psz_localname);
- }
- free (path);
-
+ int fd = utf8_open (path, O_RDONLY | O_NONBLOCK /* O_LARGEFILE*/, 0666);
if (fd == -1)
{
msg_Err (p_access, "cannot open file %s (%s)", psz_name,
}
else
{
- char *psz_localname = ToLocale( p_access->psz_name );
- char *psz_tmp, *psz_tmp2, *psz_rewriten;
- int fd, i, i_length = strlen( psz_localname );
- for( i = 0, psz_tmp = psz_localname ;
+ const char *psz_tmp;
+ char *psz_tmp2, *psz_rewriten;
+ int fd, i, i_length = strlen( p_access->psz_name );
+ for( i = 0, psz_tmp = p_access->psz_name ;
( psz_tmp = strstr( psz_tmp, "%T" ) ) ; psz_tmp++, i++ )
;
if( i )
psz_rewriten = (char *) malloc( i_length );
if( ! psz_rewriten )
return ( VLC_EGENERIC );
- psz_tmp = psz_localname;
+ psz_tmp = p_access->psz_name;
psz_tmp2 = psz_rewriten;
while( *psz_tmp )
{
*psz_tmp2++ = *psz_tmp++;
}
*psz_tmp2 = *psz_tmp;
- fd = open( psz_rewriten, i_flags, 0666 );
- LocaleFree( psz_localname );
+ fd = utf8_open( psz_rewriten, i_flags, 0666 );
free( psz_rewriten );
}
else
- {
- fd = open( psz_localname, i_flags, 0666 );
- LocaleFree( psz_localname );
- }
+ fd = utf8_open( p_access->psz_name, i_flags, 0666 );
+
if( fd == -1 )
{
msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_name,