diff options
author | nicm <nicm> | 2022-12-16 08:19:58 +0000 |
---|---|---|
committer | nicm <nicm> | 2022-12-16 08:19:58 +0000 |
commit | 8bd17bff49888d11f9cb19955e778bdcbc4eeea6 (patch) | |
tree | a3d0e70ab583900566ce605b26acd96a644450b9 /utf8.c | |
parent | 3b3f42053a5f11af5285392a5a072facbc16f4a9 (diff) | |
download | rtmux-8bd17bff49888d11f9cb19955e778bdcbc4eeea6.tar.gz rtmux-8bd17bff49888d11f9cb19955e778bdcbc4eeea6.tar.bz2 rtmux-8bd17bff49888d11f9cb19955e778bdcbc4eeea6.zip |
Make U+FE0F VARIATION SELECTOR-16 change the width from 1 to 2. GitHub
issue 3409.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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); } /* |