is_utf8.h 296 B

12345678910
  1. #ifndef IS_UTF8
  2. #include <stddef.h>
  3. // Check whether the provided string is UTF-8.
  4. // The function is designed for use cases where
  5. // 99.99% of the inputs are valid UTF-8.
  6. // Thus the function unconditionally scans the
  7. // whole input.
  8. bool is_utf8(const char *src, size_t len);
  9. #endif // IS_UTF8