mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-19 02:13:39 -05:00
fix(notes): preserve file encoding when writing to filesystem (#59)
This commit is contained in:
@@ -448,7 +448,8 @@ class Note:
|
||||
|
||||
try:
|
||||
log.trace(f"Writing note {p} to disk")
|
||||
p.write_text(self.file_content)
|
||||
content_bytes = bytes(self.file_content, self.encoding)
|
||||
p.write_bytes(content_bytes)
|
||||
except FileNotFoundError as e:
|
||||
alerts.error(f"Note {p} not found. Exiting")
|
||||
raise typer.Exit(code=1) from e
|
||||
|
||||
Reference in New Issue
Block a user