summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-14 11:22:55 -0400
committerpommicket <pommicket@gmail.com>2023-07-14 11:23:51 -0400
commit34ef28ec01a2475d9629dcc3f1e7891b5c92acfe (patch)
treed05b1266a9a9b36d259bb4c27c864a8542f1a997
parentd27853b51f09c080b1c78201a947fcb6b6cc6b72 (diff)
fix writing of unicode btwn U+8000 and U+FFFF
-rw-r--r--unicode.h2
1 files changed, 1 insertions, 1 deletions
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));