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

Function has_prohibited_utf_bom

utf8.c:631–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631int has_prohibited_utf_bom(const char *enc, const char *data, size_t len)
632{
633 return (
634 (same_utf_encoding("UTF-16BE", enc) ||
635 same_utf_encoding("UTF-16LE", enc)) &&
636 (has_bom_prefix(data, len, utf16_be_bom, sizeof(utf16_be_bom)) ||
637 has_bom_prefix(data, len, utf16_le_bom, sizeof(utf16_le_bom)))
638 ) || (
639 (same_utf_encoding("UTF-32BE", enc) ||
640 same_utf_encoding("UTF-32LE", enc)) &&
641 (has_bom_prefix(data, len, utf32_be_bom, sizeof(utf32_be_bom)) ||
642 has_bom_prefix(data, len, utf32_le_bom, sizeof(utf32_le_bom)))
643 );
644}
645
646int is_missing_required_utf_bom(const char *enc, const char *data, size_t len)
647{

Callers 1

validate_encodingFunction · 0.85

Calls 2

same_utf_encodingFunction · 0.85
has_bom_prefixFunction · 0.85

Tested by

no test coverage detected