summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2021-05-30 18:04:19 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-30 18:04:19 +0200
commitf883d9027c750967b115b82de984ee449ab17aa8 (patch)
tree9b023aace09c2f3a253327440f0520db88abf961 /src/option.c
parente71c0ebe2cee4a4916c49e206733200299e4c065 (diff)
patch 8.2.2912: MS-Windows: most users expect using Unicodev8.2.2912
Problem: MS-Windows: most users expect using Unicode. Solution: Default 'encoding' to utf-8 on MS-Windows. (Ken Takata, closes #3907)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c
index 7c783757b2..6ca424e12e 100644
--- a/src/option.c
+++ b/src/option.c
@@ -430,14 +430,21 @@ set_init_1(int clean_arg)
# endif
# endif
+# ifdef MSWIN
+ // MS-Windows has builtin support for conversion to and from Unicode, using
+ // "utf-8" for 'encoding' should work best for most users.
+ p = vim_strsave((char_u *)ENC_DFLT);
+# else
// enc_locale() will try to find the encoding of the current locale.
+ // This works best for properly configured systems, old and new.
p = enc_locale();
+# endif
if (p != NULL)
{
char_u *save_enc;
// Try setting 'encoding' and check if the value is valid.
- // If not, go back to the default "latin1".
+ // If not, go back to the default encoding.
save_enc = p_enc;
p_enc = p;
if (STRCMP(p_enc, "gb18030") == 0)