消息 [272718]
For more info here, cgi.parse has code like this:
def parse(fp, ...):
if fp is None:
fp = sys.stdin
encoding = getattr(fp, 'encoding', 'latin-1')
# later on...
return urllib.parse.parse_qs(a_str, encoding=encoding, ...)
As an easy hack, I added this after assigning encoding:
if len(' '.encode(encoding, errors='replace')) > 1:
encoding = 'latin-1'
I have no idea if this is a good idea or not. The current behaviour of mojibake in the parsed result is certainly worse, since the choice of utf-16-le is entirely contained within the parse() function. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2016-08-15 04:52:28 | steve.dower | 修改 | recipients:
+ steve.dower, lemburg, mhammond, terry.reedy, paul.moore, tzot, amaury.forgeotdarc, ncoghlan, pitrou, giampaolo.rodola, christian.heimes, tim.golden, mark, ned.deily, christoph, ezio.melotti, v+python, hippietrail, ssbarnea, flox, davidsarah, santoso.wijaya, akira, BreamoreBoy, David.Sankel, smerlin, lilydjwg, martin.panter, piotr.dobrogost, Drekin, wiz21, stijn, Jonitis, escapewindow, dead1ne |
| 2016-08-15 04:52:28 | steve.dower | 修改 | messageid: <1471236748.78.0.102773005894.issue1602@psf.upfronthosting.co.za> |
| 2016-08-15 04:52:28 | steve.dower | 链接 | issue1602 messages |
| 2016-08-15 04:52:28 | steve.dower | 创建 | |
|