From 03fc67cc74cc08fff5eb61e855b54174683614ff Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Thu, 24 Nov 2022 12:48:39 +0000 Subject: Speed up string vector filtering and loading. We can assume that string vectors generated by tofi are already normalised, so don't waste time normalising them again. Also make sure to validate strings from the user. --- src/unicode.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/unicode.h') diff --git a/src/unicode.h b/src/unicode.h index e198231..d32303d 100644 --- a/src/unicode.h +++ b/src/unicode.h @@ -2,6 +2,7 @@ #define UNICODE_H #include +#include #include uint8_t utf32_to_utf8(uint32_t c, char *buf); @@ -24,5 +25,6 @@ size_t utf8_strlen(const char *s); char *utf8_strcasestr(const char * restrict haystack, const char * restrict needle); char *utf8_normalize(const char *s); char *utf8_compose(const char *s); +bool utf8_validate(const char *s); #endif /* UNICODE_H */ -- cgit v1.2.3