diff src/mbyte.c @ 24754:a4cb7499fa11 v8.2.2915

patch 8.2.2915: MS-Windows: when using "default" for encoding utf-8 is used Commit: https://github.com/vim/vim/commit/ef8706fb84cfe8bd58b1b26b0742e42caf09655b Author: K.Takata <kentkt@csc.jp> Date: Mon May 31 18:40:49 2021 +0200 patch 8.2.2915: MS-Windows: when using "default" for encoding utf-8 is used Problem: MS-Windows: when using "default" for encoding utf-8 is used. Solution: Use the system encoding. (Ken Takata, closes https://github.com/vim/vim/issues/8300)
author Bram Moolenaar <Bram@vim.org>
date Mon, 31 May 2021 18:45:03 +0200
parents 7da496081b91
children 7334bf933510
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4453,8 +4453,13 @@ enc_canonize(char_u *enc)
 
     if (STRCMP(enc, "default") == 0)
     {
+#ifdef MSWIN
+	// Use the system encoding, the default is always utf-8.
+	r = enc_locale();
+#else
 	// Use the default encoding as it's found by set_init_1().
 	r = get_encoding_default();
+#endif
 	if (r == NULL)
 	    r = (char_u *)ENC_DFLT;
 	return vim_strsave(r);