Fixed encoding when writing text files (#197)

This commit is contained in:
MoonRide303 2023-08-18 21:25:05 +02:00 committed by GitHub
parent 64a45417d9
commit cb5c4b1b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,11 +12,11 @@ def log(img, dic):
html_name = os.path.join(os.path.dirname(local_temp_filename), 'log.html')
if not os.path.exists(html_name):
with open(html_name, 'a+') as f:
with open(html_name, 'a+', encoding='utf-8') as f:
f.write(f"<p>Fooocus Log {date_string} (private)</p>\n")
f.write(f"<p>All images do not contain any hidden data.</p>")
with open(html_name, 'a+') as f:
with open(html_name, 'a+', encoding='utf-8') as f:
div_name = only_name.replace('.', '_')
f.write(f'<div id="{div_name}"><hr>\n')
f.write(f"<p>{only_name}</p>\n")