perf: 修复ansible stdout 中非utf8的问题

This commit is contained in:
ibuler
2021-11-01 18:12:45 +08:00
committed by 老广
parent 8071f45f92
commit d484885762
2 changed files with 8 additions and 2 deletions

View File

@@ -3,3 +3,7 @@ import re
def no_special_chars(s):
return bool(re.match(r'\w+$', s))
def safe_str(s):
return s.encode('utf-8', errors='ignore').decode('utf-8')