def mysql_encode(t):
 return ('CHAR(%s)' % ','.join((str(ord(c)) for c in t)))

def mysql_encode ( t ) : return ( 'CHAR(%s)' % ',' . join ( ( str ( ord ( c ) ) for c in t ) ) )
convert the text to a char-like mysql command .