MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / common_utf8_is_complete

Function common_utf8_is_complete

common/unicode.cpp:72–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool common_utf8_is_complete(const std::string & s) {
73 if (s.empty()) {
74 return true;
75 }
76 for (int i = 1; i <= std::min(4, (int)s.size()); i++) {
77 unsigned char c = s[s.size() - i];
78 if ((c & 0xC0) != 0x80) {
79 int expected = (c >= 0xF0) ? 4 : (c >= 0xE0) ? 3 : (c >= 0xC0) ? 2 : 1;
80 return i >= expected;
81 }
82 }
83 return false;
84}
85
86std::string common_unicode_cpts_to_utf8(const std::vector<uint32_t> & cps) {
87 std::string result;

Callers 2

Calls 3

minFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1