mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.0992: terminal title is wrong when 'encoding' is DBCS
Problem: Terminal title is wrong when 'encoding' is DBCS. Solution: Convert the title from DBCS to utf-8. (Yasuhiro Matsumoto, closes #2009)
This commit is contained in:
parent
6c4d12c527
commit
33d66bd9fa
@ -1837,6 +1837,24 @@ handle_settermprop(
|
|||||||
* displayed */
|
* displayed */
|
||||||
if (*skipwhite((char_u *)value->string) == NUL)
|
if (*skipwhite((char_u *)value->string) == NUL)
|
||||||
term->tl_title = NULL;
|
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
|
else
|
||||||
term->tl_title = vim_strsave((char_u *)value->string);
|
term->tl_title = vim_strsave((char_u *)value->string);
|
||||||
vim_free(term->tl_status_text);
|
vim_free(term->tl_status_text);
|
||||||
|
@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
992,
|
||||||
/**/
|
/**/
|
||||||
991,
|
991,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user