def read_file(file_path):
    """Read files based on encoding and return all file lines

    :param file_path: Path
    :param encoding: str
    :return:
    """
    lines = []
    with file_path.open(encoding="utf-8") as file:
        all_lines = file.readlines()
    for line in all_lines:
        if line.strip():
            lines.append(line.strip())
    return lines