diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-12-19 22:46:22 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-12-19 22:46:22 +0000 |
commit | 1cd871b5341bf43ee99e136844e3131014880f92 (patch) | |
tree | 6bd9573dbc14de3c4ec85e424cbec9c8d1ee0ed8 /src/mbyte.c | |
parent | 46c9c73de8def79baf8f0a34a12549f6c14944f3 (diff) | |
download | vim-git-1cd871b5341bf43ee99e136844e3131014880f92.tar.gz |
updated for version 7.0023v7.0023
Diffstat (limited to 'src/mbyte.c')
-rw-r--r-- | src/mbyte.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mbyte.c b/src/mbyte.c index 071096653..e739a5b04 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -680,7 +680,7 @@ codepage_invalid: /* When using Unicode, set default for 'fileencodings'. */ if (enc_utf8 && !option_was_set((char_u *)"fencs")) set_string_option_direct((char_u *)"fencs", -1, - (char_u *)"ucs-bom,utf-8,latin1", OPT_FREE); + (char_u *)"ucs-bom,utf-8,default,latin1", OPT_FREE); #if defined(HAVE_BIND_TEXTDOMAIN_CODESET) && defined(FEAT_GETTEXT) /* GNU gettext 0.10.37 supports this feature: set the codeset used for * translated messages independently from the current locale. */ @@ -2590,7 +2590,7 @@ mb_prevptr(line, p) char_u *p; { if (p > line) - p = p - (*mb_head_off)(line, p - 1) - 1; + mb_ptr_back(line, p); return p; } @@ -2746,6 +2746,17 @@ enc_canonize(enc) char_u *p, *s; int i; +# ifdef FEAT_MBYTE + if (STRCMP(enc, "default") == 0) + { + /* Use the default encoding as it's found by set_init_1(). */ + r = get_encoding_default(); + if (r == NULL) + r = (char_u *)"latin1"; + return vim_strsave(r); + } +# endif + /* copy "enc" to allocted memory, with room for two '-' */ r = alloc((unsigned)(STRLEN(enc) + 3)); if (r != NULL) |