Update lib/core/common.py

Fixing wrong assumption in case of MySQL inference international character retrieval
This commit is contained in:
Miroslav Stampar 2012-12-19 01:26:12 +01:00
parent aeda67e945
commit 50b846b5af

View File

@ -2500,13 +2500,7 @@ def decodeIntToUnicode(value):
if isinstance(value, int): if isinstance(value, int):
try: try:
# http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_ord retVal = unichr(value)
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: except:
retVal = INFERENCE_UNKNOWN_CHAR retVal = INFERENCE_UNKNOWN_CHAR