emdashes begone (#10847)

This commit is contained in:
Tom
2026-07-01 19:01:27 -05:00
committed by GitHub
co-authored by GitHub
parent dee94e0758
commit 3becaf2d95
276 changed files with 1795 additions and 1793 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ void test_ascii_unchanged()
void test_valid_2byte_unchanged()
{
// "café" é is C3 A9
// "café" - é is C3 A9
char buf[16] = "caf\xC3\xA9";
TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf)));
TEST_ASSERT_EQUAL_STRING("caf\xC3\xA9", buf);
@@ -40,7 +40,7 @@ void test_valid_4byte_emoji_unchanged()
void test_valid_mixed_unchanged()
{
// "Hi 🌙!" mix of ASCII and 4-byte
// "Hi 🌙!" - mix of ASCII and 4-byte
char buf[16] = "Hi \xF0\x9F\x8C\x99!";
TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf)));
TEST_ASSERT_EQUAL_STRING("Hi \xF0\x9F\x8C\x99!", buf);
@@ -98,7 +98,7 @@ void test_overlong_2byte()
void test_surrogate_half()
{
// ED A0 80 encodes U+D800 (surrogate half invalid in UTF-8)
// ED A0 80 encodes U+D800 (surrogate half - invalid in UTF-8)
char buf[8] = "\xED\xA0\x80";
TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf)));
TEST_ASSERT_EQUAL_STRING("???", buf);
@@ -106,7 +106,7 @@ void test_surrogate_half()
void test_5byte_sequence_rejected()
{
// F8 80 80 80 80 5-byte sequence, not valid UTF-8
// F8 80 80 80 80 - 5-byte sequence, not valid UTF-8
char buf[8] = "\xF8\x80\x80\x80\x80";
TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf)));
// F8 is invalid lead (>= 0xF8), each 0x80 is bare continuation