Update lib/core/common.py

Revert of last commit and try 2
This commit is contained in:
Miroslav Stampar 2012-12-19 01:48:53 +01:00
parent 8e95470415
commit c9b8b51c9c

View File

@ -2501,7 +2501,13 @@ def decodeIntToUnicode(value):
if isinstance(value, int):
try:
retVal = unichr(value)
# http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_ord
if Backend.getIdentifiedDbms() in (DBMS.MYSQL,):
retVal = getUnicode(struct.pack('B' if value < 256 else '>H', value))
elif value > 255:
retVal = unichr(value)
else:
retVal = getUnicode(chr(value))
except:
retVal = INFERENCE_UNKNOWN_CHAR