24 #ifndef ASTERISK_UTF8_H 25 #define ASTERISK_UTF8_H enum ast_utf8_validation_result ast_utf8_validator_feed(struct ast_utf8_validator *validator, const char *data)
Feed a zero-terminated string into the UTF-8 validator.
The consumed sequence is invalid UTF-8.
void ast_utf8_validator_destroy(struct ast_utf8_validator *validator)
Destroy a UTF-8 validator.
enum ast_utf8_validation_result ast_utf8_validator_state(struct ast_utf8_validator *validator)
Get the current UTF-8 validator state.
int ast_utf8_is_valid(const char *str)
Check if a zero-terminated string is valid UTF-8.
int ast_utf8_validator_new(struct ast_utf8_validator **validator)
Create a new UTF-8 validator.
int ast_utf8_init(void)
Register UTF-8 tests.
void ast_utf8_validator_reset(struct ast_utf8_validator *validator)
Reset the state of a UTF-8 validator.
The consumed sequence is valid UTF-8.
ast_utf8_validation_result
int ast_utf8_is_validn(const char *str, size_t size)
Check if the first size bytes of a string are valid UTF-8.
The validator is in an intermediate state.
enum ast_utf8_validation_result ast_utf8_validator_feedn(struct ast_utf8_validator *validator, const char *data, size_t size)
Feed a string into the UTF-8 validator.
void ast_utf8_copy_string(char *dst, const char *src, size_t size)
Copy a string safely ensuring valid UTF-8.