Skip to content

Commit 6c4d12c

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

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/terminal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ move_terminal_to_buffer(term_T *term)
945945
width = 1;
946946
vim_memset(p + pos.col, 0, sizeof(cellattr_T));
947947
if (ga_grow(&ga, 1) == OK)
948-
ga.ga_len += mb_char2bytes(' ',
948+
ga.ga_len += utf_char2bytes(' ',
949949
(char_u *)ga.ga_data + ga.ga_len);
950950
}
951951
else
@@ -1943,7 +1943,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
19431943
break;
19441944
}
19451945
for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i)
1946-
ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c,
1946+
ga.ga_len += utf_char2bytes(c == NUL ? ' ' : c,
19471947
(char_u *)ga.ga_data + ga.ga_len);
19481948
p[col].width = cells[col].width;
19491949
p[col].attrs = cells[col].attrs;

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+
991,
772774
/**/
773775
990,
774776
/**/

0 commit comments

Comments
 (0)