comparison src/terminal.c @ 12224:bccf3de74724 v8.0.0992

patch 8.0.0992: terminal title is wrong when 'encoding' is DBCS commit https://github.com/vim/vim/commit/33d66bd9fa0e1b3fbba33d6a1a0609915ac79441 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 23 23:51:58 2017 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Thu, 24 Aug 2017 00:00:05 +0200
parents 43f03e584002
children 2e47dc775ec1
comparison
equal deleted inserted replaced
12223:3d4af6d86841 12224:bccf3de74724
1835 vim_free(term->tl_title); 1835 vim_free(term->tl_title);
1836 /* a blank title isn't useful, make it empty, so that "running" is 1836 /* a blank title isn't useful, make it empty, so that "running" is
1837 * displayed */ 1837 * displayed */
1838 if (*skipwhite((char_u *)value->string) == NUL) 1838 if (*skipwhite((char_u *)value->string) == NUL)
1839 term->tl_title = NULL; 1839 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
1840 else 1858 else
1841 term->tl_title = vim_strsave((char_u *)value->string); 1859 term->tl_title = vim_strsave((char_u *)value->string);
1842 vim_free(term->tl_status_text); 1860 vim_free(term->tl_status_text);
1843 term->tl_status_text = NULL; 1861 term->tl_status_text = NULL;
1844 if (term == curbuf->b_term) 1862 if (term == curbuf->b_term)