Index: subversion/libsvn_subr/cmdline.c
===================================================================
--- subversion/libsvn_subr/cmdline.c	(revision 10988)
+++ subversion/libsvn_subr/cmdline.c	(working copy)
@@ -25,6 +25,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <mbctype.h>
 #endif
 
 #include <apr_errno.h>          /* for apr_strerror */
@@ -163,7 +164,7 @@
 #ifdef ENABLE_NLS
 #ifdef WIN32
   {
-    WCHAR ucs2_path[MAX_PATH];
+    WCHAR ucs2_path[MAX_PATH] = {0};
     char* utf8_path;
     const char* internal_path;
     apr_pool_t* pool;
@@ -173,7 +174,14 @@
     apr_pool_create (&pool, 0);
     /* get exe name - our locale info will be in '../share/locale' */
     inwords = sizeof (ucs2_path) / sizeof(ucs2_path[0]);
-    GetModuleFileNameW (0, ucs2_path, inwords);
+    if (! GetModuleFileNameW (0, ucs2_path, inwords))
+      {
+        CHAR ansi_path[MAX_PATH] = {0};
+        GetModuleFileNameA (0, ansi_path, sizeof (ansi_path));
+        MultiByteToWideChar (_getmbcp (), MB_PRECOMPOSED, ansi_path,
+                             lstrlenA (ansi_path), ucs2_path,
+                             sizeof (ucs2_path) / sizeof (ucs2_path[0]));
+      }
     inwords = lstrlenW (ucs2_path);
     outbytes = outlength = 3 * (inwords + 1);
     utf8_path = apr_palloc (pool, outlength);
