From 8bd17bff49888d11f9cb19955e778bdcbc4eeea6 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 16 Dec 2022 08:19:58 +0000 Subject: Make U+FE0F VARIATION SELECTOR-16 change the width from 1 to 2. GitHub issue 3409. --- utf8.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'utf8.c') diff --git a/utf8.c b/utf8.c index 55a68110..03918cd2 100644 --- a/utf8.c +++ b/utf8.c @@ -227,12 +227,11 @@ utf8_width(struct utf8_data *ud, int *width) return (UTF8_ERROR); } *width = wcwidth(wc); - if (*width < 0 || *width > 0xff) { - log_debug("UTF-8 %.*s, wcwidth() %d", (int)ud->size, ud->data, - *width); - return (UTF8_ERROR); - } - return (UTF8_DONE); + log_debug("UTF-8 %.*s %#x, wcwidth() %d", (int)ud->size, ud->data, + (u_int)wc, *width); + if (*width >= 0 && *width <= 0xff) + return (UTF8_DONE); + return (UTF8_ERROR); } /* -- cgit