def process_bind_param(self, value, dialect): if isinstance(value, (unicode, str)): return codecs.ascii_decode(value.encode('utf8'), 'ignore')[0] #return b(value).decode(ESCAPE, 'replace') return value