add hook to automatically switch unicode characters to nearest equivalent. #3
Open
Description
use unidecode
python module to switch non ascii characters within UTF8 to nearest ascii equivalent.
with open(this_path) as f:
file_contents = f.read()
if not file_contents.isascii():
print(
f"Invalid: {dirpath} - {filename} contained non-ascii chars found by Python"
)
with open(this_path, "wt", encoding="utf-8") as this_file:
this_file.write(unidecode(file_contents))
Metadata
Assignees
Labels
No labels