def METHOD_NAME(input, errors, encoding_table):
    t = []
    for car in input:
        code = encoding_table.get(car)
        if code is None:
            raise UnicodeEncodeError(input)
        t.append(code)
    return bytes(t), len(input)