Method: pylint.checkers.unicode._encode_without_bom
Calls: 187, Exceptions: 0, Paths: 1Back
Path 1: 187 calls (1.0)
'# Example File containing bad ASCII' (16) '# invalid char backspace: \x08' (16) '# Bad carriage-return \r # not at the end' (16) '# Invalid char sub:...
'utf-8' (43) 'utf-16' (27) 'utf-32' (27) 'utf-16le' (17) 'utf-32le' (17) 'iso-8859-1' (12) 'ascii' (12) 'utf-16be' (11) 'utf-32be' (11) 'utf' (10)
bytes (187)
1def _encode_without_bom(string: str, encoding: str) -> bytes:
2 """Encode a string but remove the BOM."""
3 return _remove_bom(string.encode(encoding), encoding)