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

Skip to content

Commit a212f0c

Browse files
committed
Another patch for #1539
1 parent 9c69f56 commit a212f0c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,16 +2943,17 @@ def decodeIntToUnicode(value):
29432943
if isinstance(value, int):
29442944
try:
29452945
if value > 255:
2946-
if Backend.isDbms(DBMS.MSSQL):
2947-
encoding = "UTF-16-BE"
2948-
else:
2949-
encoding = conf.charset
2950-
29512946
_ = "%x" % value
29522947
if len(_) % 2 == 1:
29532948
_ = "0%s" % _
2949+
raw = hexdecode(_)
29542950

2955-
retVal = getUnicode(hexdecode(_), encoding)
2951+
if Backend.isDbms(DBMS.MSSQL):
2952+
retVal = getUnicode(raw, "UTF-16-BE")
2953+
elif Backend.isDbms(DBMS.PGSQL):
2954+
retVal = unichr(value)
2955+
else:
2956+
retVal = getUnicode(raw, conf.charset)
29562957
else:
29572958
retVal = getUnicode(chr(value))
29582959
except:

0 commit comments

Comments
 (0)