-#ifdef __APPLE__
-/* Define this if the OS always use UTF-8 internally */
-# define ASSUME_UTF8 1
-#endif
-
-#if defined (ASSUME_UTF8)
-/* Cool */
-#elif defined (WIN32) || defined (UNDER_CE)
-# define USE_MB2MB 1
-#elif defined (HAVE_ICONV)
-# define USE_ICONV 1
-#else
-# error No UTF8 charset conversion implemented on this platform!
+#ifdef WIN32
+static int convert_path (const char *restrict path, wchar_t *restrict wpath)
+{
+ if (!MultiByteToWideChar (CP_UTF8, 0, path, -1, wpath, MAX_PATH))
+ {
+ errno = ENOENT;
+ return -1;
+ }
+ wpath[MAX_PATH] = L'\0';
+ return 0;
+}
+# define CONVERT_PATH(path, wpath, err) \
+ wchar_t wpath[MAX_PATH+1]; \
+ if (convert_path (path, wpath)) \
+ return (err)