UTF-8 support (initial commit)

This commit is contained in:
2026-03-10 18:51:58 +02:00
parent 110c4b4649
commit 27911d3886
31 changed files with 57 additions and 32 deletions
+9
View File
@@ -0,0 +1,9 @@
#include <stddef.h>
size_t count_utf8_code_points(const char *s) {
size_t count = 0;
while (*s) {
count += (*s++ & 0xC0) != 0x80;
}
return count;
}
+7
View File
@@ -0,0 +1,7 @@
#ifndef UTF8_H
#define UTF8_H
#include <stddef.h>
size_t count_utf8_code_points(const char *s);
#endif
+1
View File
@@ -1,4 +1,5 @@
#ifndef D_UTILS_H
#define D_UTILS_H
#include "d_array.h"
#include "utf8.h"
#endif