Printing the offending strings on check
by using the unidecode module for printing ASCII transliterations of the offending unicode strings to the terminal/log
(issue
@@ -2766,6 +2766,7 @@ def com_google_fonts_test_073(ttFont):
)
def com_google_fonts_test_074(ttFont):
"""Are there non-ASCII characters in ASCII-only NAME table entries ?"""
+ from unidecode import unidecode
bad_entries = []
for name in ttFont["name"].names:
# Items with NameID > 18 are expressly for localising
@@ -2776,6 +2777,7 @@ def com_google_fonts_test_074(ttFont):
string.encode('ascii')
except:
bad_entries.append(name)
+ yield INFO, "Bad string: '{}'".format(unidecode(string))
if len(bad_entries) > 0:
yield FAIL, ("There are {} strings containing"
" non-ASCII characters in the ASCII-only"
