From 45233042e7c15d0f73dcf0d22a67f27b0cdca9ca Mon Sep 17 00:00:00 2001 From: tangxinfa Date: Wed, 29 Oct 2025 14:28:12 +0800 Subject: [PATCH] fix: support c --- include/is_utf8.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/is_utf8.h b/include/is_utf8.h index a39ba3c..6c5ef95 100644 --- a/include/is_utf8.h +++ b/include/is_utf8.h @@ -1,10 +1,21 @@ #ifndef IS_UTF8 +#define IS_UTF8 + #include +#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