From 01c33b1c50a73e20271c3f1670ab35478ba6cb97 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 11 Dec 2014 10:00:27 +0100 Subject: [PATCH] Fix off-by ones in UTF-8 parsing in terminal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 11100000 (224) was misinterpreted as 2-byte sequence, whereas it defines a 3-byte - 11110000 (240) was misinterpreted as 3-byte sequence, whereas it defines a 4-byte Makes it possible to type characters from the Supplementary Multilingual Plane such as 𐎒 and 𝄐. --- v/term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v/term.c b/v/term.c index 06017d4945..8114e165c2 100644 --- a/v/term.c +++ b/v/term.c @@ -828,9 +828,9 @@ _term_io_suck_char(u3_utty* uty_u, c3_y cay_y) tat_u->fut.len_w = 1; tat_u->fut.syb_y[0] = cay_y; - if ( cay_y <= 224 ) { + if ( cay_y < 224 ) { tat_u->fut.wid_w = 2; - } else if ( cay_y <= 240 ) { + } else if ( cay_y < 240 ) { tat_u->fut.wid_w = 3; } else tat_u->fut.wid_w = 4; }