summaryrefslogtreecommitdiffstats
path: root/src/mbyte.c
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2021-05-31 18:40:49 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-31 18:40:49 +0200
commitef8706fb84cfe8bd58b1b26b0742e42caf09655b (patch)
tree7f8f75d086eb8f3248077fefdcf3d2201e4e600e /src/mbyte.c
parent2fa9384ca1b600b934bec81a72c5fb7ce757503a (diff)
patch 8.2.2915: MS-Windows: when using "default" for encoding utf-8 is usedv8.2.2915
Problem: MS-Windows: when using "default" for encoding utf-8 is used. Solution: Use the system encoding. (Ken Takata, closes #8300)
Diffstat (limited to 'src/mbyte.c')
-rw-r--r--src/mbyte.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mbyte.c b/src/mbyte.c
index f3fdc32e8e..697e58520f 100644
--- 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);