patch 8.0.0094 v8.0.0094
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Nov 2016 16:28:44 +0000 (17:28 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Nov 2016 16:28:44 +0000 (17:28 +0100)
Problem:    When vimrun.exe is not found the error message is not properly
            encoded.
Solution:   Use utf-16 and MessageBoxW(). (Ken Takata)

src/os_win32.c
src/version.c

index f8e0f117d74b509e46b38aaac692a85e99c0ef33..34b2ca8384e940e11864a789d614dfd1636a12e7 100644 (file)
@@ -4705,12 +4705,24 @@ mch_call_shell(
 #if defined(FEAT_GUI_W32)
                if (need_vimrun_warning)
                {
-                   MessageBox(NULL,
-                           _("VIMRUN.EXE not found in your $PATH.\n"
-                               "External commands will not pause after completion.\n"
-                               "See  :help win32-vimrun  for more information."),
-                           _("Vim Warning"),
-                           MB_ICONWARNING);
+                   char *msg = _("VIMRUN.EXE not found in your $PATH.\n"
+                       "External commands will not pause after completion.\n"
+                       "See  :help win32-vimrun  for more information.");
+                   char *title = _("Vim Warning");
+# ifdef FEAT_MBYTE
+                   if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+                   {
+                       WCHAR *wmsg = enc_to_utf16((char_u *)msg, NULL);
+                       WCHAR *wtitle = enc_to_utf16((char_u *)title, NULL);
+
+                       if (wmsg != NULL && wtitle != NULL)
+                           MessageBoxW(NULL, wmsg, wtitle, MB_ICONWARNING);
+                       vim_free(wmsg);
+                       vim_free(wtitle);
+                   }
+                   else
+# endif
+                       MessageBox(NULL, msg, title, MB_ICONWARNING);
                    need_vimrun_warning = FALSE;
                }
                if (!s_dont_use_vimrun && p_stmp)
index 65f12936b5273006597250d4efa933fc369bce18..1224142b89b1a7ab660331edb3963460adb2cb24 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    94,
 /**/
     93,
 /**/