Skip to content

Commit 7051083

Browse files
committed
Update "unicode_to_ascii.py" utility.
1 parent e6cb295 commit 7051083

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

utilities/unicode_to_ascii.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def unicode_to_ascii(root_directory):
4646

4747
for root, dirnames, filenames in os.walk(root_directory):
4848
for filename in filenames:
49-
if (not filename.endswith('.py') and
50-
not filename.endswith('.bib') and
51-
not filename.endswith('.rst')):
49+
if (not filename.endswith('.tex') and not filename.endswith('.py')
50+
and not filename.endswith('.bib')
51+
and not filename.endswith('.rst')):
5252
continue
5353

5454
if filename == 'unicode_to_ascii.py':
@@ -62,8 +62,7 @@ def unicode_to_ascii(root_directory):
6262
for key, value in SUBSTITUTIONS.items():
6363
content = content.replace(key, value)
6464

65-
content = unicodedata.normalize('NFD', content).encode(
66-
'ascii', 'ignore')
65+
content = unicodedata.normalize('NFD', content)
6766

6867
file_handle.write(content)
6968

0 commit comments

Comments
 (0)