MCPcopy Create free account
hub / github.com/cinder/Cinder / is_overlong_sequence

Function is_overlong_sequence

include/utf8cpp/core.h:116–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115 template <typename octet_difference_type>
116 inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length)
117 {
118 if (cp < 0x80) {
119 if (length != 1)
120 return true;
121 }
122 else if (cp < 0x800) {
123 if (length != 2)
124 return true;
125 }
126 else if (cp < 0x10000) {
127 if (length != 3)
128 return true;
129 }
130
131 return false;
132 }
133
134 enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
135

Callers 1

validate_nextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected