MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pl_utf8_len

Function pl_utf8_len

internal/cbm/doclink_perl.c:256–267  ·  view source on GitHub ↗

Bytes of the UTF-8 character that `lead` starts; 1 for anything else. */

Source from the content-addressed store, hash-verified

254
255/* Bytes of the UTF-8 character that `lead` starts; 1 for anything else. */
256static size_t pl_utf8_len(unsigned char lead) {
257 if (lead >= PL_UTF8_LEAD4 && lead < PL_UTF8_LEAD_END) {
258 return 4;
259 }
260 if (lead >= PL_UTF8_LEAD3 && lead < PL_UTF8_LEAD4) {
261 return 3;
262 }
263 if (lead >= PL_UTF8_LEAD2 && lead < PL_UTF8_LEAD3) {
264 return PAIR_LEN;
265 }
266 return SKIP_ONE;
267}
268
269/* Append t[0, n): white-space runs become one space (none at the start),
270 * control bytes are dropped, and a character that does not fit whole ends

Callers 1

pl_out_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected