MCPcopy Create free account
hub / github.com/axmolengine/axmol / isLegalUTF8String

Function isLegalUTF8String

3rdparty/ConvertUTF/ConvertUTF.cpp:556–564  ·  view source on GitHub ↗

* Exported function to return whether a UTF-8 string is legal or not. * This is not used here; it's just exported. */

Source from the content-addressed store, hash-verified

554 * This is not used here; it's just exported.
555 */
556Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) {
557 while (*source != sourceEnd) {
558 int length = trailingBytesForUTF8[**source] + 1;
559 if (length > sourceEnd - *source || !isLegalUTF8(*source, length))
560 return false;
561 *source += length;
562 }
563 return true;
564}
565
566/* --------------------------------------------------------------------- */
567

Callers

nothing calls this directly

Calls 1

isLegalUTF8Function · 0.85

Tested by

no test coverage detected