Make U+FE0F VARIATION SELECTOR-16 change the width from 1 to 2. GitHub

issue 3409.
This commit is contained in:
nicm
2022-12-16 08:19:58 +00:00
parent 3b3f42053a
commit 8bd17bff49
2 changed files with 16 additions and 9 deletions

11
utf8.c
View File

@ -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);
}
/*