From c9b8b51c9c067d622ec1ad15ed29974fb9c82093 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 19 Dec 2012 01:48:53 +0100 Subject: [PATCH] Update lib/core/common.py Revert of last commit and try 2 --- lib/core/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index 7d2c36db8..8b0447117 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -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