Another update related to the #1539

This commit is contained in:
Miroslav Stampar
2015-11-16 15:33:05 +01:00
parent c1e3431877
commit 94639d11a3
6 changed files with 20 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
import binascii
from lib.core.convert import utf8encode
from lib.core.settings import DEFAULT_MYSQL_CHARACTER_SET
from plugins.generic.syntax import Syntax as GenericSyntax
class Syntax(GenericSyntax):
@@ -26,7 +27,7 @@ class Syntax(GenericSyntax):
try:
retVal = "0x%s" % binascii.hexlify(value)
except UnicodeEncodeError:
retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
retVal = "CONVERT(0x%s USING %s)" % ("".join("%.2x" % ord(_) for _ in utf8encode(value)), DEFAULT_MYSQL_CHARACTER_SET)
return retVal
return Syntax._escape(expression, quote, escaper)