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)