Skip to content

Commit

Permalink
Specified encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolykopyl committed Apr 5, 2021
1 parent 6c658e0 commit 15c047a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ def export(dirname, stats, link, imghash, img, text):
itempath = pathjoin(path, "data/{}/{}".format(groupname.lower(), imghash))
check_n_create(itempath)
img.save(itempath+"/image.png", format='PNG')
with open(itempath+"/raw.txt", "w") as f:
with open(itempath+"/raw.txt", "w", encoding="utf-8") as f:
f.write(text)
with open(itempath+"/links.txt", "w") as f:
with open(itempath+"/links.txt", "w", encoding="utf-8") as f:
f.write(f"https://prnt.sc/{link}\n")
with open(itempath+"/stats.txt", "w") as f:
with open(itempath+"/stats.txt", "w", encoding="utf-8") as f:
f.write(json.dumps(stats))

htmlfile = path+"/"+groupname+".html"
if not isfile(htmlfile):
with open(htmlfile, 'w') as f:
with open(htmlfile, 'w', encoding="utf-8") as f:
f.write(top_part.format(
"file:///"+pwd+"/",
"file:///"+pwd+"/",
Expand Down

0 comments on commit 15c047a

Please sign in to comment.