diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-21 15:23:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-21 15:23:35 +0200 |
commit | 663bbc09babea1ff8dfa7ccd58801ac9219fc2b2 (patch) | |
tree | 2ce9218e29fe7dcfdee8fc6242fff422d7f921b4 | |
parent | b4fe0eb4b4fe52a68a1df05162c03fe51c2fce79 (diff) |
patch 8.1.1725: MS-Windows: E325 message may use incorrect date formatv8.1.1725
Problem: MS-Windows: E325 message may use incorrect date format.
Solution: Convert strftime() result to 'encoding'. Also make the message
translatable. (Ken Takata, closes #4685, closes #4681)
-rw-r--r-- | src/memline.c | 19 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c index 0a947f9273..e401c73fa2 100644 --- a/src/memline.c +++ b/src/memline.c @@ -2142,7 +2142,24 @@ get_ctime(time_t thetime, int add_newline) if (curtime == NULL) vim_strncpy((char_u *)buf, (char_u *)_("(Invalid)"), sizeof(buf) - 1); else - (void)strftime(buf, sizeof(buf) - 1, "%a %b %d %H:%M:%S %Y", curtime); + { + (void)strftime(buf, sizeof(buf) - 1, _("%a %b %d %H:%M:%S %Y"), + curtime); +# ifdef MSWIN + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { + char_u *to_free = NULL; + int len; + + acp_to_enc((char_u *)buf, (int)strlen(buf), &to_free, &len); + if (to_free != NULL) + { + STRCPY(buf, to_free); + vim_free(to_free); + } + } +# endif + } #else STRCPY(buf, "(unknown)"); #endif diff --git a/src/version.c b/src/version.c index 8a98f510a4..afdefb2708 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1725, +/**/ 1724, /**/ 1723, |