fix for a bug reported by saccurso@skygear.com​.ar (UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal

not in range(128))
This commit is contained in:
Miroslav Stampar 2011-04-21 23:17:16 +00:00
parent 1d61611145
commit 41924a6ead

View File

@ -60,7 +60,7 @@ def safechardecode(value):
while True:
match = regex.search(retVal)
if match:
retVal = retVal.replace(match.group("result"), binascii.unhexlify(match.group("result").lstrip('\\x')))
retVal = retVal.replace(match.group("result"), unichr(ord(binascii.unhexlify(match.group("result").lstrip('\\x')))))
else:
break