diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-23 23:36:25 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-23 23:36:25 +0200 |
commit | 6c4d12c5278fc6b7a6dee2043bc1af713f894ae5 (patch) | |
tree | 11059207fb8e060beef92afc2e103a31dc636b41 /src/terminal.c | |
parent | 285f243e506f15230270e4d15679acc29e489e7c (diff) | |
download | vim-git-6c4d12c5278fc6b7a6dee2043bc1af713f894ae5.tar.gz |
patch 8.0.0991: using wrong character conversion for DBCSv8.0.0991
Problem: Using wrong character conversion for DBCS.
Solution: Use utf_char2bytes instead of mb_char2bytes. (Yasuhiro Matsumoto,
closes #2012)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c index 7fadbb693..67c065ced 100644 --- 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 VTermScreenCell *cells, void *user) 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; |