Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb2cb25

Browse files
committed
Bug fix for an Issue #1539
1 parent a6ea190 commit fb2cb25

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2943,10 +2943,16 @@ def decodeIntToUnicode(value):
29432943
if isinstance(value, int):
29442944
try:
29452945
if value > 255:
2946+
if Backend.isDbms(DBMS.MSSQL):
2947+
encoding="UTF-16-LE" if isDBMSVersionAtLeast("2012") else "UTF-16-BE"
2948+
else:
2949+
encoding = conf.charset
2950+
29462951
_ = "%x" % value
29472952
if len(_) % 2 == 1:
29482953
_ = "0%s" % _
2949-
retVal = getUnicode(hexdecode(_), encoding="UTF-16" if Backend.isDbms(DBMS.MSSQL) else None)
2954+
2955+
retVal = getUnicode(hexdecode(_), encoding)
29502956
else:
29512957
retVal = getUnicode(chr(value))
29522958
except:

0 commit comments

Comments
 (0)