From fb2cb25afe6892394a2b991e79b879f8ba558523 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 16 Nov 2015 11:56:06 +0100 Subject: [PATCH] Bug fix for an Issue #1539 --- 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 fd1b375fa..f4b4f7b04 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2943,10 +2943,16 @@ def decodeIntToUnicode(value): if isinstance(value, int): try: if value > 255: + if Backend.isDbms(DBMS.MSSQL): + encoding="UTF-16-LE" if isDBMSVersionAtLeast("2012") else "UTF-16-BE" + else: + encoding = conf.charset + _ = "%x" % value if len(_) % 2 == 1: _ = "0%s" % _ - retVal = getUnicode(hexdecode(_), encoding="UTF-16" if Backend.isDbms(DBMS.MSSQL) else None) + + retVal = getUnicode(hexdecode(_), encoding) else: retVal = getUnicode(chr(value)) except: