def METHOD_NAME(data: bytes, version: bytes, encoding: str,
                             log) -> tuple[str, str]:
    """parses an 8 character version string"""
    version_str = version.strip().decode(encoding)
    if version.startswith(b'NX'):
        mode = 'nx'
        version_str = version[2:].strip().decode(encoding)
        if version_str not in NX_VERSIONS:
            log.warning(f'nx version={version_str!r} is not supported')
    elif version.startswith(b'MODEP'):
        # TODO: why is this separate?
        # F:\work\pyNastran\pyNastran\master2\pyNastran\bdf\test\nx_spike\out_ac11103.op2
        #print('found NX table?...')
        #log.warning('Assuming NX Nastran')
        mode = 'nx'
    elif version.startswith(b'AEROFREQ'):
        # TODO: why is this separate?
        # C:\Users\Steve\Dropbox\pyNastran_examples\move_tpl\loadf.op2
        #print('found MSC table?...')
        #log.warning('Assuming MSC Nastran')
        mode = 'msc'
    elif version.startswith(b'AEROTRAN'):
        # TODO: why is this separate?
        # C:\Users\Steve\Dropbox\pyNastran_examples\move_tpl\loadf.op2
        #log.warning('Assuming MSC Nastran')
        mode = 'msc'
    elif version in MSC_VERSIONS:
        mode = 'msc'
    #elif version in [b'XXXXXXXX']:
        ##log.warning('Assuming MSC Nastran')
        #mode = 'msc'
    elif version in OPTISTRUCT_VERSIONS:
        # should this be called optistruct or radioss?
        mode = 'optistruct'
    elif version in AUTODESK_VERSIONS:
        mode = 'autodesk'
    #elif data[:20] == b'XXXXXXXX20141   0   ':
        #self.set_as_msc()
        #self.set_table_type()
    elif version == b'NASA95':
        mode = 'nasa95'
    else:
        raise RuntimeError(f'unknown version={version!r}')
    return mode, version_str