To: vim_dev@googlegroups.com Subject: Patch 8.0.0991 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0991 Problem: Using wrong character conversion for DBCS. Solution: Use utf_char2bytes instead of mb_char2bytes. (Yasuhiro Matsumoto, closes #2012) Files: src/terminal.c *** ../vim-8.0.0990/src/terminal.c 2017-08-23 23:10:15.861895854 +0200 --- src/terminal.c 2017-08-23 23:34:31.108236139 +0200 *************** *** 945,951 **** width = 1; vim_memset(p + pos.col, 0, sizeof(cellattr_T)); if (ga_grow(&ga, 1) == OK) ! ga.ga_len += mb_char2bytes(' ', (char_u *)ga.ga_data + ga.ga_len); } else --- 945,951 ---- width = 1; vim_memset(p + pos.col, 0, sizeof(cellattr_T)); if (ga_grow(&ga, 1) == OK) ! ga.ga_len += utf_char2bytes(' ', (char_u *)ga.ga_data + ga.ga_len); } else *************** *** 1943,1949 **** break; } for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i) ! ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c, (char_u *)ga.ga_data + ga.ga_len); p[col].width = cells[col].width; p[col].attrs = cells[col].attrs; --- 1943,1949 ---- break; } for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i) ! 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; *** ../vim-8.0.0990/src/version.c 2017-08-23 23:10:15.861895854 +0200 --- src/version.c 2017-08-23 23:35:38.451791912 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 991, /**/ -- Everybody wants to go to heaven, but nobody wants to die. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///