This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 pitrou
收信人 Arfrever, ezio.melotti, lemburg, ncoghlan, pitrou, r.david.murray, serhiy.storchaka, vstinner
日期 2014-09-23.11:23:47
SpamBayes Score -1.0
Marked as misclassified
Message-id <1411471427.31.0.791719184051.issue18814@psf.upfronthosting.co.za>
In-reply-to
内容
The encoding used impacts the result:

>>> s = 'abc\udcc3\udca9'
>>> s.encode('ascii', 'surrogateescape').decode('ascii', 'replace')
'abc��'
>>> s.encode('utf-8', 'surrogateescape').decode('utf-8', 'replace')
'abcé'

The original string ('abc\udcc3\udca9') was obtained by decoding a valid utf-8 string with the 'ascii' codec and the 'surrogateescape' error handler.

If anything, the default encoding should probably be sys.getfilesystemencoding().
历史
日期 用户 动作 参数
2014-09-23 11:23:47pitrou修改recipients: + pitrou, lemburg, ncoghlan, vstinner, ezio.melotti, Arfrever, r.david.murray, serhiy.storchaka
2014-09-23 11:23:47pitrou修改messageid: <1411471427.31.0.791719184051.issue18814@psf.upfronthosting.co.za>
2014-09-23 11:23:47pitrou链接issue18814 messages
2014-09-23 11:23:47pitrou创建