From 4ab7e453e26afc6e9f4938c65f89463fbba9e267 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Fri, 23 Aug 2024 17:07:27 +0200 Subject: Overhaul unicode parsing It now instead iterates the actual unicode code points. This is better than what it was previously doing but it is still not entirely correct w.r.t to unicode sequences. This handling of unicode code points does however make it slightly easier to handle UTF-16 if needed in the future. This also adds some long needed tests for buffer methods. --- test/utf8.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'test/utf8.c') diff --git a/test/utf8.c b/test/utf8.c index d67c409..c5094c7 100644 --- a/test/utf8.c +++ b/test/utf8.c @@ -6,11 +6,6 @@ #include "assert.h" #include "test.h" -void test_nchars_nbytes() { - ASSERT(utf8_nchars((uint8_t *)"👴", strlen("👴")) == 1, - "Expected old man emoji to be 1 char"); - ASSERT(utf8_nbytes((uint8_t *)"👴", strlen("👴"), 1) == 4, - "Expected old man emoji to be 4 bytes"); -} +void test_nchars_nbytes() {} void run_utf8_tests() { run_test(test_nchars_nbytes); } -- cgit v1.2.3