Potential patch for #3178

This commit is contained in:
Miroslav Stampar
2018-07-10 15:35:07 +02:00
parent 53eadb0af8
commit 29dcdd3bef
3 changed files with 4 additions and 4 deletions

View File

@@ -2334,7 +2334,7 @@ def getUnicode(value, encoding=None, noneToNull=False):
try:
return unicode(value, UNICODE_ENCODING)
except:
value = value[:ex.start] + "".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in value[ex.start:ex.end]) + value[ex.end:]
value = getUnicode(value[:ex.start], UNICODE_ENCODING) + u"".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in value[ex.start:ex.end]) + getUnicode(value[ex.end:], UNICODE_ENCODING)
elif isListLike(value):
value = list(getUnicode(_, encoding, noneToNull) for _ in value)
return value