Patch regarding #4066

This commit is contained in:
Miroslav Stampar
2020-01-09 11:59:50 +01:00
parent 71b33e5956
commit eb3a3b4825
3 changed files with 7 additions and 4 deletions

View File

@@ -26,6 +26,6 @@ class Syntax(GenericSyntax):
if all(_ < 128 for _ in getOrds(value)):
return "0x%s" % getUnicode(binascii.hexlify(getBytes(value)))
else:
return "CONVERT(0x%s USING utf8)" % getUnicode(binascii.hexlify(getBytes(value)))
return "CONVERT(0x%s USING utf8)" % getUnicode(binascii.hexlify(getBytes(value, "utf8")))
return Syntax._escape(expression, quote, escaper)