# HG changeset patch # User Bram Moolenaar # Date 1549625407 -3600 # Node ID 2958a8e51a671b9761888e35ab0715a153f7d888 # Parent 4dfd751fda99e73b9584990076f85fe1ba2c4a0b patch 8.1.0879: MS-Windows: temp name encoding can be wrong commit https://github.com/vim/vim/commit/0036201a1a096913840d3df8ff08eb58eaae90a6 Author: Bram Moolenaar Date: Fri Feb 8 12:21:30 2019 +0100 patch 8.1.0879: MS-Windows: temp name encoding can be wrong Problem: MS-Windows: temp name encoding can be wrong. Solution: Convert from active code page to 'encoding'. (Ken Takata, closes #3520, closes #1698) diff --git a/src/fileio.c b/src/fileio.c --- a/src/fileio.c +++ b/src/fileio.c @@ -7470,6 +7470,24 @@ vim_tempname( for (p = retval; *p; ++p) if (*p == '\\') *p = '/'; + +#if defined(FEAT_MBYTE) && defined(WIN3264) + if (enc_utf8) + { + int len; + char_u *pp = NULL; + + // Convert from active codepage to UTF-8 since mch_call_shell() + // converts command-line to wide string from encoding. + acp_to_enc(retval, (int)STRLEN(retval), &pp, &len); + if (pp != NULL) + { + vim_free(retval); + return pp; + } + } +#endif + return retval; # else /* WIN3264 */ diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -784,6 +784,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 879, +/**/ 878, /**/ 877,