utf8proc bits for utf8_fromwc.

This commit is contained in:
Nicholas Marriott 2024-07-12 14:30:56 +01:00
parent d02254f754
commit 5039be657c
1 changed files with 5 additions and 0 deletions

5
utf8.c
View File

@ -24,6 +24,7 @@
#include <string.h>
#include <wchar.h>
#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);