def _read_header(file):
    """Process the listfile header."""
    header = []
    while True:
        line = file.readline().decode('utf-8').strip()
        if line in ('[LISTDATA]', '[DATA]'):
            break
        header.append(line)
    is_ascii = False
    if '[MPA4A]' in header[0]:
        version = 4
        is_ascii = True
    else:
        version = 3
    return file, header, version, is_ascii
