mirror of
https://github.com/hanzoai/utf-8-validate.git
synced 2026-09-24 17:03:57 +00:00
Use the is_utf8 [1] library to greatly improve performance. [1]: https://github.com/simdutf/is_utf8
10 lines
296 B
C
10 lines
296 B
C
#ifndef IS_UTF8
|
|
#include <stddef.h>
|
|
|
|
// Check whether the provided string is UTF-8.
|
|
// The function is designed for use cases where
|
|
// 99.99% of the inputs are valid UTF-8.
|
|
// Thus the function unconditionally scans the
|
|
// whole input.
|
|
bool is_utf8(const char *src, size_t len);
|
|
#endif // IS_UTF8
|