MCPcopy Create free account
hub / github.com/Kitware/CMake / cm_utf8_is_valid

Function cm_utf8_is_valid

Source/cm_utf8.c:96–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96int cm_utf8_is_valid(char const* s)
97{
98 if (!s) {
99 return 0;
100 }
101
102 char const* last = s + strlen(s);
103 char const* pos = s;
104 unsigned int pc;
105
106 while (pos != last && (pos = cm_utf8_decode_character(pos, last, &pc))) {
107 /* Nothing to do. */
108 }
109
110 return pos == last;
111}

Callers 2

is_validFunction · 0.85
is_invalidFunction · 0.85

Calls 2

cm_utf8_decode_characterFunction · 0.85
strlenFunction · 0.50

Tested by 2

is_validFunction · 0.68
is_invalidFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…