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

Skip to content

Commit 8617fe0

Browse files
committed
Bug fix for international letters decoded with --hex on MsSQL
1 parent ca427af commit 8617fe0

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,16 +3209,11 @@ def _(value):
32093209
if value.lower().startswith("0x"):
32103210
value = value[2:]
32113211
value = value.decode("hex")
3212-
if len(value) > 1 and value[1] == '\x00':
3212+
if Backend.isDbms(DBMS.MSSQL):
32133213
try:
32143214
value = value.decode("utf-16-le")
32153215
except UnicodeDecodeError:
32163216
pass
3217-
elif value and value[0] == '\x00':
3218-
try:
3219-
value = value.decode("utf-16-be")
3220-
except UnicodeDecodeError:
3221-
pass
32223217
if not isinstance(value, unicode):
32233218
value = value.decode("utf8", "replace")
32243219
return value

0 commit comments

Comments
 (0)