diff --git a/typstwriter/editor.py b/typstwriter/editor.py index 784c6ae..2b055e0 100644 --- a/typstwriter/editor.py +++ b/typstwriter/editor.py @@ -383,7 +383,7 @@ def __init__(self, path=None, font_size=None): def load(self, path): """Load file.""" try: - with open(path, "r") as file: + with open(path, "r", encoding="utf-8") as file: filecontent = file.read() self.edit.setPlainText(filecontent) @@ -416,7 +416,7 @@ def write(self): logger.debug("Saving to: {!r}.", self.path) try: - with open(self.path, "w") as f: + with open(self.path, "w", encoding="utf-8") as f: f.write(self.edit.document().toPlainText()) self.justsaved = True