diff --git a/src/nmreval/io/graceeditor.py b/src/nmreval/io/graceeditor.py index cdde89c..8cb09fe 100644 --- a/src/nmreval/io/graceeditor.py +++ b/src/nmreval/io/graceeditor.py @@ -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()