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/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/main.c') diff --git a/test/main.c b/test/main.c index 4c241b3..dc0c2dc 100644 --- a/test/main.c +++ b/test/main.c @@ -9,7 +9,9 @@ void handle_abort() { exit(1); } int main() { - setlocale(LC_ALL, ""); + // Use a hardcoded locale to get a + // predictable env. + setlocale(LC_ALL, "en_US.UTF-8"); signal(SIGABRT, handle_abort); struct timespec test_begin; @@ -52,5 +54,6 @@ int main() { ((uint64_t)test_begin.tv_sec * 1e9 + (uint64_t)test_begin.tv_nsec); printf("\nšŸŽ‰ \x1b[1;32mDone! All tests successful in %.2f ms!\x1b[0m\n", (double)elapsed_nanos / 1e6); + return 0; } -- cgit v1.2.3