MCPcopy Index your code
hub / github.com/git/git / is_missing_required_utf_bom

Function is_missing_required_utf_bom

utf8.c:646–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646int is_missing_required_utf_bom(const char *enc, const char *data, size_t len)
647{
648 return (
649 (same_utf_encoding(enc, "UTF-16")) &&
650 !(has_bom_prefix(data, len, utf16_be_bom, sizeof(utf16_be_bom)) ||
651 has_bom_prefix(data, len, utf16_le_bom, sizeof(utf16_le_bom)))
652 ) || (
653 (same_utf_encoding(enc, "UTF-32")) &&
654 !(has_bom_prefix(data, len, utf32_be_bom, sizeof(utf32_be_bom)) ||
655 has_bom_prefix(data, len, utf32_le_bom, sizeof(utf32_le_bom)))
656 );
657}
658
659/*
660 * Returns first character length in bytes for multi-byte `text` according to

Callers 1

validate_encodingFunction · 0.85

Calls 2

same_utf_encodingFunction · 0.85
has_bom_prefixFunction · 0.85

Tested by

no test coverage detected