--- src/misc/unicode.c~	2006-11-19 19:08:27.000000000 +1100
+++ src/misc/unicode.c	2006-11-19 18:59:59.000000000 +1100
@@ -429,7 +429,11 @@
 
 void *utf8_opendir( const char *dirname )
 {
-    /* TODO: support for WinNT non-ACP filenames */
+
+#if defined (UNDER_CE) || defined (WIN32)
+    DIR *dir = vlc_opendir_wrapper( dirname );
+    return dir;
+#else
     const char *local_name = ToLocale( dirname );
 
     if( local_name != NULL )
@@ -440,6 +444,8 @@
     }
     else
         errno = ENOENT;
+#endif
+
     return NULL;
 }
 
@@ -452,7 +458,11 @@
     if( ent == NULL )
         return NULL;
 
+#if defined (UNDER_CE) || defined (WIN32)
+    return FromWide(ent->d_name);
+#else
     return vlc_fix_readdir( ent->d_name );
+#endif
 }
 
 static int dummy_select( const char *str )
--- src/extras/libc.c~	2006-11-19 19:07:45.000000000 +1100
+++ src/extras/libc.c	2006-11-19 18:57:19.000000000 +1100
@@ -416,7 +416,17 @@
         return (void *)p_dir;
     }
 
-    p_real_dir = opendir( psz_path );
+    if (GetVersion() < 0x80000000)
+    {
+        /* for Windows NT and above */
+        wchar_t wpath[MAX_PATH + 1];
+
+        if (!MultiByteToWideChar (CP_UTF8, 0, psz_path, -1, wpath, MAX_PATH))
+            return NULL;
+        wpath[MAX_PATH] = L'\0';
+        p_real_dir = _wopendir( wpath );
+    }
+
     if ( p_real_dir == NULL )
         return NULL;
 
@@ -445,7 +455,7 @@
             return &p_dir->dd_dir;
         }
 
-        return readdir( p_dir->p_real_dir );
+        return _wreaddir( p_dir->p_real_dir );
     }
 
     /* Drive letters mode */
@@ -471,7 +481,7 @@
 
     if ( p_dir->p_real_dir != NULL )
     {
-        int i_ret = closedir( p_dir->p_real_dir );
+        int i_ret = _wclosedir( p_dir->p_real_dir );
         free( p_dir );
         return i_ret;
     }
