Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion include/is_utf8.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#ifndef IS_UTF8
#define IS_UTF8

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

// 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.
extern "C" bool is_utf8(const char *src, size_t len);
bool is_utf8(const char *src, size_t len);

#ifdef __cplusplus
}
#endif

#endif // IS_UTF8