Message252738
| Author |
methane |
| Recipients |
ezio.melotti, methane, python-dev, r.david.murray, serhiy.storchaka, vstinner |
| Date |
2015年10月10日.19:15:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1444504554.0.0.646010145038.issue24870@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
UTF-8 and Latin1 are typical encoding for MySQL query.
When inserting BLOB:
# Decode binary data
x = data.decode('ascii', 'surrogateescape')
# %-format query
psql = sql % (escape(x),) # sql is unicode
# Encode sql to connection encoding (latin1 or utf8)
query_bytes = psql.encode('utf-8', 'surrogateescape')
So decoder speedup is required only for ascii, but encoder speedup is required for utf-8 and latin1.
I'll consider other ways including creating speedup module and register it on PyPI. |
|