Merge pull request #745 from BillSchumacher/fix-read-file-encoding-issue

Use UTF-8 encoding for Windows users.
pull/759/head
Toran Bruce Richards 2023-04-11 02:05:31 +01:00 committed by GitHub
commit 6582e9b646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ def read_file(filename):
"""Read a file and return the contents""" """Read a file and return the contents"""
try: try:
filepath = safe_join(working_directory, filename) filepath = safe_join(working_directory, filename)
with open(filepath, "r") as f: with open(filepath, "r", encoding='utf-8') as f:
content = f.read() content = f.read()
return content return content
except Exception as e: except Exception as e: