From 417924361bbcfef8fe7f98147b9003f79e8bd10d Mon Sep 17 00:00:00 2001 From: Bzero Date: Wed, 23 Jul 2025 23:35:19 +0200 Subject: [PATCH 1/2] Save files with UTF8 encoding. --- typstwriter/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typstwriter/editor.py b/typstwriter/editor.py index 784c6ae..59576ed 100644 --- a/typstwriter/editor.py +++ b/typstwriter/editor.py @@ -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 From fda7e4d39af9ea06752c304312244f4c1f0ea473 Mon Sep 17 00:00:00 2001 From: Bzero Date: Thu, 14 Aug 2025 23:48:39 +0200 Subject: [PATCH 2/2] Open files with UTF8 encoding. --- typstwriter/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typstwriter/editor.py b/typstwriter/editor.py index 59576ed..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)