| 1 | // C wrapper of the utf8proc library |
| 2 | |
| 3 | #pragma once |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | //! Returns whether or not the string is valid UTF8 |
| 10 | int utf8proc_is_valid(const char *s, size_t len); |
| 11 | |
| 12 | //! Returns the position (in bytes) of the next grapheme cluster |
| 13 | size_t utf8proc_next_grapheme_cluster(const char *s, size_t len, size_t pos); |
| 14 | |
| 15 | //! Returns the position (in bytes) of the previous grapheme cluster |
| 16 | size_t utf8proc_prev_grapheme_cluster(const char *s, size_t len, size_t pos); |
| 17 | |
| 18 | //! Returns the render width [0, 1 or 2] of the grapheme cluster as the specified position |
| 19 | size_t utf8proc_render_width(const char *s, size_t len, size_t pos); |
| 20 | |
| 21 | #ifdef __cplusplus |
| 22 | }; |
| 23 | #endif |
| 24 | |