def detectBOM(data):
    """Search for unicode Byte Order Marks (BOM)
    """
    boms = {'utf-8': b'\xef\xbb\xbf', 'utf-16-le': b'\xff\xfe', 'utf-16-be':
        b'\xfe\xff', 'utf-32-le': b'\xff\xfe\x00\x00', 'utf-32-be':
        b'\x00\x00\xfe\xff'}
    for encoding, bom in list(boms.items()):
        if data.startswith(bom):
            return encoding, bom
    return None, None
