Skip to content

Commit b7f1836

Browse files
authored
Merge pull request #6 from Garulf/fix-encoding
Fix: Add missing file encoding
2 parents de81f41 + 9c918f6 commit b7f1836

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "Obsidian Notes",
55
"Description": "Search Obsidian notes",
66
"Author": "Garulf",
7-
"Version": "1.1.0",
7+
"Version": "1.1.1",
88
"Language": "python",
99
"Website": "https://github.com/Garulf/obsidian-notes",
1010
"IcoPath": "./icon.png",

plugin/obsidian.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def get_vaults():
1515
vaults = []
1616
try:
17-
with open(VAULTS_PATH, 'r') as f:
17+
with open(VAULTS_PATH, 'r', encoding='utf-8') as f:
1818
data = json.load(f)
1919
except FileNotFoundError:
2020
logger.error(f'{VAULTS_PATH} not found!\nIs obsidian installed?')
@@ -26,7 +26,7 @@ def get_vaults():
2626

2727
def get_vault(id):
2828
try:
29-
with open(VAULTS_PATH, 'r') as f:
29+
with open(VAULTS_PATH, 'r', encoding='utf-8') as f:
3030
data = json.load(f)
3131
except FileNotFoundError:
3232
logger.error(f'{VAULTS_PATH} not found!\nIs obsidian installed?')
@@ -82,7 +82,7 @@ def open_note(self):
8282
open_note(self.vault.name, self.relative_path)
8383

8484
def content(self):
85-
with open(self.path, 'r') as f:
85+
with open(self.path, 'r', encoding='utf-8') as f:
8686
return f.read()
8787

8888

@@ -96,7 +96,7 @@ def toggle_checkbox(self, raw):
9696
toggled_line = line.replace(CHECK_BOX, MARKED_CHECK_BOX)
9797
break
9898
content = content.replace(line, toggled_line)
99-
with open(self.path, 'w') as f:
99+
with open(self.path, 'w', encoding='utf-8') as f:
100100
f.write(content)
101101

102102
def checklists(self):

0 commit comments

Comments
 (0)