diff --git a/E3S1PROFORKBYTT_printdata_superslicer_thumbnail.py b/E3S1PROFORKBYTT_printdata_superslicer_thumbnail.py index 35a2754..2b6d27f 100644 --- a/E3S1PROFORKBYTT_printdata_superslicer_thumbnail.py +++ b/E3S1PROFORKBYTT_printdata_superslicer_thumbnail.py @@ -21,7 +21,7 @@ import re sourceFile = sys.argv[1] # Read the ENTIRE g-code file into memory -with open(sourceFile, "r") as f: +with open(sourceFile, "r", encoding='utf-8') as f: lines = f.readlines() new_lines = [] @@ -126,7 +126,7 @@ for i, line in enumerate(new_lines): m117_added += 1 # Write the modified content back to the original file -with open(sourceFile, "w") as f: +with open(sourceFile, "w", encoding='utf-8') as f: f.writelines(new_lines) -print(f"Added {m117_added} M117 commands and M73 with time information.") \ No newline at end of file +print(f"Added {m117_added} M117 commands and M73 with time information.")