Skip to content

Commit 33d66bd

Browse files
committed
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)
1 parent 6c4d12c commit 33d66bd

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/terminal.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,24 @@ handle_settermprop(
18371837
* displayed */
18381838
if (*skipwhite((char_u *)value->string) == NUL)
18391839
term->tl_title = NULL;
1840+
#ifdef WIN3264
1841+
else if (!enc_utf8 && enc_codepage > 0)
1842+
{
1843+
WCHAR *ret = NULL;
1844+
int length = 0;
1845+
1846+
MultiByteToWideChar_alloc(CP_UTF8, 0,
1847+
(char*)value->string, STRLEN(value->string),
1848+
&ret, &length);
1849+
if (ret != NULL)
1850+
{
1851+
WideCharToMultiByte_alloc(enc_codepage, 0,
1852+
ret, length, (char**)&term->tl_title,
1853+
&length, 0, 0);
1854+
vim_free(ret);
1855+
}
1856+
}
1857+
#endif
18401858
else
18411859
term->tl_title = vim_strsave((char_u *)value->string);
18421860
vim_free(term->tl_status_text);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
992,
772774
/**/
773775
991,
774776
/**/

0 commit comments

Comments
 (0)