1 Commits

Author SHA1 Message Date
2f2e854d07 Add encoding to read/write 2025-10-10 13:24:43 +00:00

View File

@@ -120,7 +120,7 @@ class GraceEditor:
# we start always with the header
current_pos = 'header'
with self.file.open('r', errors='replace') as f:
with self.file.open('r', errors='replace', encoding='iso-8859-15') as f:
for line_nr, line in enumerate(f):
# lots of states to check
# agr file order: header, drawing object, region, graph, set
@@ -331,7 +331,7 @@ class GraceEditor:
def write(self, fname):
outfile = pathlib.Path(fname)
with outfile.open('w') as f:
with outfile.open('w', encoding='iso-8859-15') as f:
f.write(str(self.header))
f.flush()