import codecs


def read_whole_file(str_path_to_file):
    """read the whole file with encoding

    Parameters
    ----------
    str_path_to_file : str
        path to file which to read
    str_encoding : str
        encoding type to use

    Returns
    -------
    str
        whole file as one string
    """
    with codecs.open(str_path_to_file, "r", "utf-8", errors="ignore") as file:
        str_whole_file = file.read()
    return str_whole_file