Auto-UTF handling (#4594)
This commit is contained in:
1 parent
de44376d1b
commit
e5e5ebc799
3 files changed
+10
-8
No files matched your search
+1
-1
@@ -124,7 +124,7 @@ def is_pip():
|
||||
|
||||
def is_ascii(s=''):
|
||||
# Is string composed of all ASCII (no UTF) characters?
|
||||
s = str(s) # convert to str() in case of None, etc.
|
||||
s = str(s) # convert list, tuple, None, etc. to str
|
||||
return len(s.encode().decode('ascii', 'ignore')) == len(s)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user