From 1159329b247d6532fecb375e7008aca979261eaa Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 29 Jan 2026 11:02:33 +0100 Subject: fix(wcwidth): add a generator for width ranges The generator script will parse official unicode data to create the actual ranges for 0, double, and ambiguous width characters. --- src/wcwidth.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/wcwidth.h') diff --git a/src/wcwidth.h b/src/wcwidth.h index 6cb6f6d..9d345f9 100644 --- a/src/wcwidth.h +++ b/src/wcwidth.h @@ -1,7 +1,8 @@ // wcwidth.h // Windows does not have a wcwidth function, so we use compatibilty code from -// http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c by Markus Kuhn +// http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c by Markus Kuhn, this is +// however heavily modified. #ifndef MK_WCWIDTH_H #define MK_WCWIDTH_H @@ -16,7 +17,7 @@ typedef uint32_t mk_wchar_t; // Windows wchar_t can be 16-bit, we need 32-bit typedef wchar_t mk_wchar_t; // Posix wchar_t is 32-bit so just use that #endif -int mk_wcwidth(mk_wchar_t ucs); -int mk_wcswidth(const mk_wchar_t *pwcs, size_t n); +int mk_wcwidth(mk_wchar_t ucs, int ambiguous_width); +int mk_wcswidth(const mk_wchar_t *pwcs, size_t n, int ambiguous_width); #endif // MK_WCWIDTH_H -- cgit v1.2.3-55-g6feb