Skip to content

Commit

Permalink
fix: file encoding - make UTF-8 explicit (#70)
Browse files Browse the repository at this point in the history
Save publication files containing UTF-8 characters (e.g. μ) correctly.

Co-authored-by: Jian Tay <[email protected]>
  • Loading branch information
jwtay1 and jwtay1 authored Aug 20, 2020
1 parent 6b3c49a commit deed003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion academic/editFM.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def load(self, file: Path):
def dump(self):
assert self.path, "You need to `.load()` first."

with open(self.path, "w") as f:
with open(self.path, "w", encoding="utf-8") as f:
f.write("{}\n".format(self.delim))
yaml.dump(self.fm, f)
f.write("{}\n".format(self.delim))
Expand Down

0 comments on commit deed003

Please sign in to comment.