Le mercredi 09 juin 2010 14:47:22, Nick Coghlan a écrit :
> *Some are obvious, such as rot13 being text only,
Should rot13 shift any unicode character, or just a-z and A-Z?
Python2 only changes characters a-z and A-Z, and use ISO-8859-1 to encode
unicode to byte string.
>>> u"abc é".encode("rot13")
'nop \xe9'
>>> u"abc \u2c01".encode("rot13")
Traceback (most recent call last):
...
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2c01' in
position 4: character maps to <undefined>
--
Victor Stinner
http://www.haypocalc.com/
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com