summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 7b5da8a4c..7f2288ee5 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -267,6 +267,10 @@ mch_early_init(void)
AnsiUpperBuff(toupper_tab, 256);
AnsiLowerBuff(tolower_tab, 256);
#endif
+
+#if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
+ (void)get_cmd_argsW(NULL);
+#endif
}
@@ -298,7 +302,25 @@ mch_settitle(
gui_mch_settitle(title, icon);
# else
if (title != NULL)
+ {
+# ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ /* Convert the title from 'encoding' to the active codepage. */
+ WCHAR *wp = enc_to_ucs2(title, NULL);
+ int n;
+
+ if (wp != NULL)
+ {
+ n = SetConsoleTitleW(wp);
+ vim_free(wp);
+ if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return;
+ }
+ }
+# endif
SetConsoleTitle(title);
+ }
# endif
}