strip_non_ascii in comments-author-name

This commit is contained in:
Jesús
2020-12-30 00:04:41 -05:00
parent 0a9d24b261
commit 056c3be3f2
3 changed files with 16 additions and 3 deletions

View File

@@ -601,3 +601,9 @@ def to_valid_filename(name):
name = '_' + name
return name
def strip_non_ascii(string):
''' Returns the string without non ASCII characters'''
stripped = (c for c in string if 0 < ord(c) < 127)
return ''.join(stripped)