This commit is contained in:
Miroslav Stampar
2021-10-26 10:05:14 +02:00
parent 8a57002b26
commit cceb5319ef
3 changed files with 19 additions and 2 deletions

View File

@@ -1431,6 +1431,19 @@ def cleanQuery(query):
return retVal
def cleanReplaceUnicode(value):
"""
Cleans unicode for proper encode/decode
>>> cleanReplaceUnicode(['a', 'b'])
['a', 'b']
"""
def clean(value):
return value.encode(UNICODE_ENCODING, errors="replace").decode(UNICODE_ENCODING) if isinstance(value, six.text_type) else value
return applyFunctionRecursively(value, clean)
def setPaths(rootPath):
"""
Sets absolute paths for project directories and files