Message138078
| Author |
vstinner |
| Recipients |
amaury.forgeotdarc, loewis, ocean-city, vstinner |
| Date |
2011年06月10日.13:37:49 |
| SpamBayes Score |
4.322411e-06 |
| Marked as misclassified |
No |
| Message-id |
<1307713071.79.0.529735593281.issue12281@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Version 2 of my patch (mbcs2.patch):
- patch also the encoder: fix ignore/replace depending on the Windows version, support any error handler: encode character per character if encoding in strict mode fails
- Add PyUnicode_DecodeCodePageStateful() and PyUnicode_EncodeCodePage() functions
- Expose these functions as codecs.code_page_decode() and codecs.code_page_encode()
The encoder raises a RuntimeError("recursive call") (ugly message!) if the result of the error handler is a Unicode string that cannot be encoded to the code page.
More TODO:
- write tests using codecs.code_page_decode() and codecs.code_page_encode()
- Fix FIXME (e.g. support surrogates in the encoder) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月10日 13:37:52 | vstinner | set | recipients:
+ vstinner, loewis, amaury.forgeotdarc, ocean-city |
| 2011年06月10日 13:37:51 | vstinner | set | messageid: <1307713071.79.0.529735593281.issue12281@psf.upfronthosting.co.za> |
| 2011年06月10日 13:37:51 | vstinner | link | issue12281 messages |
| 2011年06月10日 13:37:51 | vstinner | create |
|