From d21a99defc5b5cbd9d7f44c626d6479a55b4f34a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 11 Jun 2022 22:45:03 -0500 Subject: [PATCH] Bugfix: Problems exposed by unit tests in f_utf. Only UTF-8 symbols are tested. --- level_0/f_utf/c/private-utf_symbol.c | 9 +++++++-- level_0/f_utf/c/utf/is.c | 2 +- level_0/f_utf/c/utf/is_character.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/level_0/f_utf/c/private-utf_symbol.c b/level_0/f_utf/c/private-utf_symbol.c index 3de39ed..e2e87bb 100644 --- a/level_0/f_utf/c/private-utf_symbol.c +++ b/level_0/f_utf/c/private-utf_symbol.c @@ -626,8 +626,13 @@ extern "C" { return F_true; } - // Halfwidth and Fullwidth Forms: U+FFE9 to U+FFEC. - if (character >= 0xefbfa900 && character <= 0xefbfac00) { + // Halfwidth and Fullwidth Forms: U+FFE8 to U+FFEE. + if (character >= 0xefbfa800 && character <= 0xefbfae00) { + return F_true; + } + + // Specials: U+FFFC to U+FFFD. + if (character == 0xefbfbc00 || character == 0xefbfbd00) { return F_true; } } diff --git a/level_0/f_utf/c/utf/is.c b/level_0/f_utf/c/utf/is.c index adb3766..a543c0a 100644 --- a/level_0/f_utf/c/utf/is.c +++ b/level_0/f_utf/c/utf/is.c @@ -668,7 +668,7 @@ extern "C" { } // ASCII: U+003C ('<') to U+003E ('>'). - if (character[0] > 0x3c && character[0] < 0x3e) { + if (character[0] >= 0x3c && character[0] <= 0x3e) { return F_true; } diff --git a/level_0/f_utf/c/utf/is_character.c b/level_0/f_utf/c/utf/is_character.c index 44e9c1b..ba722d3 100644 --- a/level_0/f_utf/c/utf/is_character.c +++ b/level_0/f_utf/c/utf/is_character.c @@ -408,7 +408,7 @@ extern "C" { } // ASCII: U+003C ('<') to U+003E ('>'). - if (character > 0x3c000000 && character < 0x3e000000) { + if (character >= 0x3c000000 && character <= 0x3e000000) { return F_true; } -- 1.8.3.1