From be40c1bb87f0513d7549d596d03b0120066eed13 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 29 Jan 2023 20:09:45 +0100 Subject: [PATCH] [charsets] compilation fix --- src/intl/charsets.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intl/charsets.c b/src/intl/charsets.c index fd3400b9..810234b7 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -299,16 +299,16 @@ static char utf_buffer[7]; NONSTATIC_INLINE char * encode_utf8(unicode_val_T u) { - int s; - - memset(utf_buffer, 0, 7); - #ifdef CONFIG_CODEPOINT if (!is_codepoint_supported(u)) { + int s; + BIN_SEARCH(unicode_7b, x, N_UNICODE_7B, u, s); if (s != -1) return (char *)unicode_7b[s].s; } #endif + memset(utf_buffer, 0, 7); + if (u < 0x80) utf_buffer[0] = u; else if (u < 0x800)