

def read_bom(data):
    'Read the byte order mark in the text, if present, and\n    return the encoding represented by the BOM and the BOM.\n\n    If no BOM can be detected, (None, None) is returned.\n    '
    if (data and (data[0] in _FIRST_CHARS)):
        for (bom, encoding) in _BOM_TABLE:
            if data.startswith(bom):
                return (encoding, bom)
    return (None, None)

dataset/ETHPy150Open lorien/grab/grab/document.py read_bom/original