MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / trailingBytes

Function trailingBytes

unittests/catch.hpp:10973–10984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10971namespace {
10972
10973 size_t trailingBytes(unsigned char c) {
10974 if ((c & 0xE0) == 0xC0) {
10975 return 2;
10976 }
10977 if ((c & 0xF0) == 0xE0) {
10978 return 3;
10979 }
10980 if ((c & 0xF8) == 0xF0) {
10981 return 4;
10982 }
10983 CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
10984 }
10985
10986 uint32_t headerValue(unsigned char c) {
10987 if ((c & 0xE0) == 0xC0) {

Callers 1

encodeToMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected