diff options
author | Phil Jones <philj56@gmail.com> | 2022-10-18 19:33:41 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-10-18 19:33:41 +0100 |
commit | 5482f0be746a98bdd6b2c54183b54dd2ff2a0192 (patch) | |
tree | dc58c6a1c486432f853bd3a5f9f7c78767c7292a /src/utf8.h | |
parent | 8872f664671711b97e02fe97f31746b5e158e627 (diff) |
Improve UTF-8 handling.
This should allow case-insensitive matching for non-Latin characters,
and fix matching for characters with diacritics.
Diffstat (limited to 'src/utf8.h')
-rw-r--r-- | src/utf8.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utf8.h b/src/utf8.h new file mode 100644 index 0000000..b6ee986 --- /dev/null +++ b/src/utf8.h @@ -0,0 +1,22 @@ +#ifndef UTF8_H +#define UTF8_H + +#include <glib.h> +#include <stdint.h> + +uint32_t utf8_isupper(uint32_t c); +uint32_t utf8_islower(uint32_t c); +uint32_t utf8_isalnum(uint32_t c); +uint32_t utf8_toupper(uint32_t c); +uint32_t utf8_tolower(uint32_t c); + +uint32_t utf8_get_char(const char *s); +char *utf8_next_char(const char *s); +char *utf8_prev_char(const char *s); +char *utf8_strchr(const char *s, uint32_t c); +char *utf8_strcasechr(const char *s, uint32_t c); +size_t utf8_strlen(const char *s); +char *utf8_strcasestr(const char * restrict haystack, const char * restrict needle); +char *utf8_normalize(const char *s); + +#endif /* UTF8_H */ |