diff --git a/pyomd/note.py b/pyomd/note.py index be0d37d..c25fd1b 100644 --- a/pyomd/note.py +++ b/pyomd/note.py @@ -30,7 +30,7 @@ def __init__(self, path: Union[Path, str]): """ self.path: Path = Path(path) try: - with open(self.path, "r") as f: + with open(self.path, "r", encoding='utf-8') as f: self.content: str = f.read() except Exception as e: raise NoteCreationError(path=path, exception=e) from e @@ -130,7 +130,7 @@ def write(self, path: Union[Path, None] = None): path to the note. If None, overwrites the current note content. """ p = self.path if path is None else path - with open(p, "w") as f: + with open(p, "w", encoding='utf-8') as f: f.write(self.content) @staticmethod