Author vstinner
Recipients amaury.forgeotdarc, loewis, ocean-city, vstinner
Date 2011-06-10.13:37:49
SpamBayes Score 4.32241e-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:52vstinnersetrecipients: + vstinner, loewis, amaury.forgeotdarc, ocean-city
2011-06-10 13:37:51vstinnersetmessageid: <1307713071.79.0.529735593281.issue12281@psf.upfronthosting.co.za>
2011-06-10 13:37:51vstinnerlinkissue12281 messages
2011-06-10 13:37:51vstinnercreate