summaryrefslogtreecommitdiffstats
path: root/Source/cm_utf8.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-03-14 18:33:28 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2019-03-18 18:18:13 (GMT)
commit53184a727d0f3b233988212628fec6ef7803da69 (patch)
tree6d533af81c3b81368b4fd0aab0c9f91ba1cb51ca /Source/cm_utf8.h
parent875f49cc588b898f5da24bff34638d16de5c6413 (diff)
downloadCMake-53184a727d0f3b233988212628fec6ef7803da69.zip
CMake-53184a727d0f3b233988212628fec6ef7803da69.tar.gz
CMake-53184a727d0f3b233988212628fec6ef7803da69.tar.bz2
cm_utf8: add an is_valid function
Diffstat (limited to 'Source/cm_utf8.h')
-rw-r--r--Source/cm_utf8.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cm_utf8.h b/Source/cm_utf8.h
index fcb43e0..27dc559 100644
--- a/Source/cm_utf8.h
+++ b/Source/cm_utf8.h
@@ -13,6 +13,10 @@ extern "C" {
const char* cm_utf8_decode_character(const char* first, const char* last,
unsigned int* pc);
+/** Returns whether a C string is a sequence of valid UTF-8 encoded Unicode
+ codepoints. Returns non-zero on success. */
+int cm_utf8_is_valid(const char* s);
+
#ifdef __cplusplus
} /* extern "C" */
#endif