changeset 12222:43f03e584002 v8.0.0991

patch 8.0.0991: using wrong character conversion for DBCS commit https://github.com/vim/vim/commit/6c4d12c5278fc6b7a6dee2043bc1af713f894ae5 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 23 23:36:25 2017 +0200 patch 8.0.0991: using wrong character conversion for DBCS Problem: Using wrong character conversion for DBCS. Solution: Use utf_char2bytes instead of mb_char2bytes. (Yasuhiro Matsumoto, closes #2012)
author Christian Brabandt <cb@256bit.org>
date Wed, 23 Aug 2017 23:45:04 +0200
parents daf75bde9642
children 3d4af6d86841
files src/terminal.c src/version.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -945,7 +945,7 @@ move_terminal_to_buffer(term_T *term)
 			width = 1;
 			vim_memset(p + pos.col, 0, sizeof(cellattr_T));
 			if (ga_grow(&ga, 1) == OK)
-			    ga.ga_len += mb_char2bytes(' ',
+			    ga.ga_len += utf_char2bytes(' ',
 					     (char_u *)ga.ga_data + ga.ga_len);
 		    }
 		    else
@@ -1943,7 +1943,7 @@ handle_pushline(int cols, const VTermScr
 		    break;
 		}
 		for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i)
-		    ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c,
+		    ga.ga_len += utf_char2bytes(c == NUL ? ' ' : c,
 					     (char_u *)ga.ga_data + ga.ga_len);
 		p[col].width = cells[col].width;
 		p[col].attrs = cells[col].attrs;
--- 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 */
 /**/
+    991,
+/**/
     990,
 /**/
     989,