diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-23 23:51:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-23 23:51:58 +0200 |
commit | 33d66bd9fa0e1b3fbba33d6a1a0609915ac79441 (patch) | |
tree | 475ecb9831bcbc298783cae576baa071d14441dd /src | |
parent | 6c4d12c5278fc6b7a6dee2043bc1af713f894ae5 (diff) |
patch 8.0.0992: terminal title is wrong when 'encoding' is DBCSv8.0.0992
Problem: Terminal title is wrong when 'encoding' is DBCS.
Solution: Convert the title from DBCS to utf-8. (Yasuhiro Matsumoto, closes
#2009)
Diffstat (limited to 'src')
-rw-r--r-- | src/terminal.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index 67c065cedd..c559d11731 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1837,6 +1837,24 @@ handle_settermprop( * displayed */ if (*skipwhite((char_u *)value->string) == NUL) term->tl_title = NULL; +#ifdef WIN3264 + else if (!enc_utf8 && enc_codepage > 0) + { + WCHAR *ret = NULL; + int length = 0; + + MultiByteToWideChar_alloc(CP_UTF8, 0, + (char*)value->string, STRLEN(value->string), + &ret, &length); + if (ret != NULL) + { + WideCharToMultiByte_alloc(enc_codepage, 0, + ret, length, (char**)&term->tl_title, + &length, 0, 0); + vim_free(ret); + } + } +#endif else term->tl_title = vim_strsave((char_u *)value->string); vim_free(term->tl_status_text); diff --git a/src/version.c b/src/version.c index a0ce86d80d..1006ca0f04 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 992, +/**/ 991, /**/ 990, |