summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-11-19 17:28:44 +0100
committerBram Moolenaar <Bram@vim.org>2016-11-19 17:28:44 +0100
commit63e4344edc0cc1b4ed68a9d9c787265799602670 (patch)
treeb78f83ab546b39e6be8085d9c0012134bdbf8a6f /src/os_win32.c
parentdda39aeafc94484e7d209d7bdfd2fc403b7383f5 (diff)
downloadvim-git-63e4344edc0cc1b4ed68a9d9c787265799602670.tar.gz
patch 8.0.0094v8.0.0094
Problem: When vimrun.exe is not found the error message is not properly encoded. Solution: Use utf-16 and MessageBoxW(). (Ken Takata)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index f8e0f117d..34b2ca838 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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)