From 34ef28ec01a2475d9629dcc3f1e7891b5c92acfe Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 14 Jul 2023 11:22:55 -0400 Subject: fix writing of unicode btwn U+8000 and U+FFFF --- unicode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unicode.h b/unicode.h index 1e517c4..c93897d 100644 --- a/unicode.h +++ b/unicode.h @@ -142,7 +142,7 @@ static size_t unicode_utf32_to_utf8(char *s, uint32_t c32) { *p++ = (uint8_t)(0xC0 | (c32 >> 6)); *p = (uint8_t)(0x80 | (c32 & 0x3F)); return 2; - } else if (c32 <= 0x7FFF) { + } else if (c32 <= 0xFFFF) { if (c32 < 0xD800 || c32 > 0xDFFF) { *p++ = (uint8_t)(0xE0 | ( c32 >> 12)); *p++ = (uint8_t)(0x80 | ((c32 >> 6) & 0x3F)); -- cgit v1.2.3