>>>Syntax.escape("SELECT 'abcdefgh' FROM foobar")=="SELECT CHAR(97)+CHAR(98)+CHAR(99)+CHAR(100)+CHAR(101)+CHAR(102)+CHAR(103)+CHAR(104) FROM foobar"
True
>>>Syntax.escape(u"SELECT 'abcd\xebfgh' FROM foobar")=="SELECT CHAR(97)+CHAR(98)+CHAR(99)+CHAR(100)+NCHAR(235)+CHAR(102)+CHAR(103)+CHAR(104) FROM foobar"