Specify UTF-8 encoding in Python script (#808)
* Specify UTF-8 encoding in Python script Fixes error on Windows * Use regular open instead of io.open Works just as well, no need for an extra import * Fix file names * Update update_readme.py --------- Co-authored-by: Terence Eden <edent@users.noreply.github.com>
This commit is contained in:
@@ -109,7 +109,7 @@ check_table += "</table>"
|
||||
readme_summary_text = f"There are currently {len(svg_list)} icons and the average size is _under_ {round(total_bytes / len(svg_list))} bytes!"
|
||||
|
||||
# Replace the table in README with the new one
|
||||
with open('README.md','r+') as f:
|
||||
with open('README.md','r+', encoding="utf-8") as f:
|
||||
file = f.read()
|
||||
|
||||
file = re.sub(r"(?s)<table>.*?</table>", readme_table, file)
|
||||
@@ -122,7 +122,7 @@ with open('README.md','r+') as f:
|
||||
print(f"README.md updated with {len(svg_list)} icons.")
|
||||
|
||||
# Replace the tables in the REFERENCE document
|
||||
with open('REFERENCE.md','r+') as f:
|
||||
with open('REFERENCE.md','r+', encoding="utf-8") as f:
|
||||
file = f.read()
|
||||
|
||||
file = re.sub(r"(?s)-\|-\|-.*", reference_table, file)
|
||||
@@ -135,7 +135,7 @@ with open('REFERENCE.md','r+') as f:
|
||||
print(f"REFERENCE.md updated.")
|
||||
|
||||
# Replace the table in the CHECK document
|
||||
with open('CHECK.html','r+') as f:
|
||||
with open('CHECK.html','r+', encoding="utf-8") as f:
|
||||
file = f.read()
|
||||
|
||||
file = re.sub(r"(?s)<table>.*?</table>", check_table, file)
|
||||
|
Reference in New Issue
Block a user