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.

Author vstinner
Recipients lemburg, loewis, vstinner
Date 2010-09-10.12:16:20
SpamBayes Score 1.4375723e-06
Marked as misclassified No
Message-id <1284120982.1.0.702350627217.issue9821@psf.upfronthosting.co.za>
In-reply-to
Content
Oh wait. PEP 383 is a solution to store undecodable bytes in an unicode string, but for mbcs I'm trying to get the opposite: store unicode in bytes and this is not possible (at least with PEP 383).

Example with Python 3.1:

>>> print("abcŁdef".encode("cp1252", "surrogateescape"))
...
UnicodeEncodeError: 'charmap' codec can't encode character '\u0141' in position 3: character maps to <undefined>
History
Date User Action Args
2010-09-10 12:16:22vstinnersetrecipients: + vstinner, lemburg, loewis
2010-09-10 12:16:22vstinnersetmessageid: <1284120982.1.0.702350627217.issue9821@psf.upfronthosting.co.za>
2010-09-10 12:16:20vstinnerlinkissue9821 messages
2010-09-10 12:16:20vstinnercreate