MCPcopy Create free account
hub / github.com/apache/arrow / validate_utf8_following_bytes

Function validate_utf8_following_bytes

cpp/src/gandiva/precompiled/string_ops.cc:164–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164FORCE_INLINE
165bool validate_utf8_following_bytes(const char* data, int32_t data_len,
166 int32_t char_index) {
167 for (int j = 1; j < data_len; ++j) {
168 if ((data[char_index + j] & 0xC0) != 0x80) { // bytes following head-byte of glyph
169 return false;
170 }
171 }
172 return true;
173}
174
175// Count the number of utf8 characters
176// return 0 for invalid/incomplete input byte sequences

Calls

no outgoing calls

Tested by

no test coverage detected