+#if defined(WIN32) || defined (UNDER_CE)
+ if(GetVersion() < 0x80000000)
+ {
+ wchar_t wpath[MAX_PATH + 1];
+ if( !MultiByteToWideChar( CP_UTF8, 0, p_demux->psz_path, -1, wpath, MAX_PATH) )
+ {
+ errno = ENOENT;
+ return VLC_EGENERIC;
+ }
+ wpath[MAX_PATH] = L'0';
+ FileRef f( wpath );
+ }
+ else return VLC_EGENERIC;
+#else
+ const char *local_name = ToLocale( p_demux->psz_path );
+
+ if( local_name == NULL )
+ {
+ return VLC_EGENERIC;
+ }
+ FileRef f( local_name );
+ LocaleFree( local_name );
+#endif
+