def remove_file_encoding(path):
    """
    Remove the encoding line from the given file.
    :param path: path to remove from
    :type path: str
    """
    with open(path, "r") as fin:
        lines = fin.readlines()
        if len(lines) >= 1 and is_encoding_line(lines[0]):
            lines.pop(0)
        elif len(lines) >= 2 and is_encoding_line(lines[1]):
            lines.pop(1)
        else:
            print("No encoding line found in '{}'!".format(path))
            return
    with open(path, "w") as fout:
        fout.write("".join(lines))

    Remove the encoding line from the given file.
    :param path: path to remove from
    :type path: str
    
tools/encoding_utils.py