From dbfa8e30d2c16c80ca0f38dc4587391691c69e9e Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:50:02 -0400 Subject: [PATCH 1/2] Encode to UTF-8 --- plugin/obsidian.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/obsidian.py b/plugin/obsidian.py index 4510770..25d4155 100644 --- a/plugin/obsidian.py +++ b/plugin/obsidian.py @@ -14,7 +14,7 @@ def get_vaults(): vaults = [] try: - with open(VAULTS_PATH, 'r') as f: + with open(VAULTS_PATH, 'r', encoding='utf-8') as f: data = json.load(f) except FileNotFoundError: logger.error(f'{VAULTS_PATH} not found!\nIs obsidian installed?') @@ -26,7 +26,7 @@ def get_vaults(): def get_vault(id): try: - with open(VAULTS_PATH, 'r') as f: + with open(VAULTS_PATH, 'r', encoding='utf-8') as f: data = json.load(f) except FileNotFoundError: logger.error(f'{VAULTS_PATH} not found!\nIs obsidian installed?') @@ -82,7 +82,7 @@ def open_note(self): open_note(self.vault.name, self.relative_path) def content(self): - with open(self.path, 'r') as f: + with open(self.path, 'r', encoding='utf-8') as f: return f.read() @@ -96,7 +96,7 @@ def toggle_checkbox(self, raw): toggled_line = line.replace(CHECK_BOX, MARKED_CHECK_BOX) break content = content.replace(line, toggled_line) - with open(self.path, 'w') as f: + with open(self.path, 'w', encoding='utf-8') as f: f.write(content) def checklists(self): From 9c918f6f4bc5b71f67bc94dbfe47884f5863e6e7 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:50:14 -0400 Subject: [PATCH 2/2] Bump version --- plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index 204ca1b..858585d 100644 --- a/plugin.json +++ b/plugin.json @@ -4,7 +4,7 @@ "Name": "Obsidian Notes", "Description": "Search Obsidian notes", "Author": "Garulf", - "Version": "1.1.0", + "Version": "1.1.1", "Language": "python", "Website": "https://github.com/Garulf/obsidian-notes", "IcoPath": "./icon.png",