diff --git a/translator_script.py b/translator_script.py index 67835e1c45ece872cc58dbe4c9dd99053bd2189b..d11bc99fa56c5ac76f13e616e42a8d97650398cd 100644 --- a/translator_script.py +++ b/translator_script.py @@ -117,15 +117,16 @@ def split_into_chunks(input_string, chunk_size=240): def write_to_file(file_path, content): try: - with open(file_path, 'w', encoding='utf-8') as file: + with open(file_path, 'w', encoding='utf-8', encoding='utf-8') as file: file.write(content) print("Successfully wrote to the file: " + file_path) + print("Successfully wrote to the file: " + file_path) except Exception as e: print(f"An error occurred: {e}") def read_from_file(file_path): try: - with open(file_path, "r", encoding='utf-8') as file: + with open(file_path, "r", encoding='utf-8') as file: return file.read() except FileNotFoundError: print(f"File not found at: {file_path}")