MCPcopy Create free account
hub / github.com/crawl/crawl / utf8_validate

Function utf8_validate

crawl-ref/source/json.cc:218–230  ·  view source on GitHub ↗

Validate a null-terminated UTF-8 string. */

Source from the content-addressed store, hash-verified

216
217/* Validate a null-terminated UTF-8 string. */
218static bool utf8_validate(const char *s)
219{
220 int len;
221
222 for (; *s != 0; s += len)
223 {
224 len = utf8_validate_cz(s);
225 if (len == 0)
226 return false;
227 }
228
229 return true;
230}
231
232/*
233 * Read a single UTF-8 character starting at @s,

Callers 2

emit_stringFunction · 0.70
json_checkFunction · 0.70

Calls 1

utf8_validate_czFunction · 0.85

Tested by

no test coverage detected