Return the Python codec name implied by a BOM prefix, or None.
(head: bytes)
| 219 | |
| 220 | |
| 221 | def _detect_bom_encoding(head: bytes) -> str | None: |
| 222 | """Return the Python codec name implied by a BOM prefix, or None.""" |
| 223 | for sig, enc in _BOM_ENCODINGS: |
| 224 | if head.startswith(sig): |
| 225 | return enc |
| 226 | return None |
| 227 | |
| 228 | |
| 229 | def _looks_like_binary(path: str) -> bool: |
no outgoing calls
no test coverage detected