From 5039be657c4263f2539a149199cbc8d6780df1c3 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 12 Jul 2024 14:30:56 +0100 Subject: [PATCH] utf8proc bits for utf8_fromwc. --- utf8.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utf8.c b/utf8.c index 7dd75d57..bc7c8fd2 100644 --- a/utf8.c +++ b/utf8.c @@ -24,6 +24,7 @@ #include #include +#include "compat.h" #include "tmux.h" static const wchar_t utf8_force_wide[] = { @@ -455,7 +456,11 @@ utf8_fromwc(wchar_t wc, struct utf8_data *ud) { int size, width; +#ifdef HAVE_UTF8PROC + size = utf8proc_wctomb(ud->data, wc); +#else size = wctomb(ud->data, wc); +#endif if (size < 0) { log_debug("UTF-8 %d, wctomb() %d", wc, errno); wctomb(NULL, 0);