homepage

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 deleted250130
Recipients deleted250130, ezio.melotti, vstinner
Date 2014年04月22日.20:58:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398200303.74.0.876201125787.issue21331@psf.upfronthosting.co.za>
In-reply-to
Content
I have made some tests with encoding/decoding in conjunction with unicode-escape and got some strange results:
>>> print('ä')
ä
>>> print('ä'.encode('utf-8'))
b'\xc3\xa4'
>>> print('ä'.encode('utf-8').decode('unicode-escape'))
ä
>>> print('ä'.encode('utf-8').decode('unicode-escape').encode('unicode-escape'))
b'\\xc3\\xa4'
>>> print('ä'.encode('utf-8').decode('unicode-escape').encode('unicode-escape').decode('utf-8'))
\xc3\xa4
Shouldn't .decode('unicode-escape').encode('unicode-escape') nullify itself and so "'ä'.encode('utf-8').decode('unicode-escape').encode('unicode-escape')" return the same result as 'ä'.encode('utf-8')?
History
Date User Action Args
2014年04月22日 20:58:23deleted250130setrecipients: + deleted250130, vstinner, ezio.melotti
2014年04月22日 20:58:23deleted250130setmessageid: <1398200303.74.0.876201125787.issue21331@psf.upfronthosting.co.za>
2014年04月22日 20:58:23deleted250130linkissue21331 messages
2014年04月22日 20:58:23deleted250130create

AltStyle によって変換されたページ (->オリジナル) /