utils: add to_ascii helper (#33492)
This commit is contained in:
parent
7aab439090
commit
46235973f0
|
@ -63,3 +63,7 @@ def clean_string(string):
|
|||
def ensure_encoding(s, encoding):
|
||||
s = clean_string(s)
|
||||
return s.encode(encoding, 'replace').decode(encoding)
|
||||
|
||||
|
||||
def to_ascii(s):
|
||||
return unidecode.unidecode(s).decode('ascii')
|
||||
|
|
Loading…
Reference in New Issue