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 Sworddragon
Recipients Sworddragon, ezio.melotti, lemburg, ncoghlan, r.david.murray, vstinner
Date 2014-04-23.06:42:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398235368.19.0.430978418857.issue21331@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation says that unicode_internal is deprecated since Python 3.3 but not unicode_escape. Also, isn't unicode_escape different from utf-8? For example my original intention was to convert 2 byte string characters to their control characters. For example the file test.txt contains the 17 byte utf-8 raw content "---a---\n---ä---". Now I want to convert '\\n' to '\n':

>>> file = open('test.txt', 'r')
>>> content = file.read()
>>> file.close()
>>> content = content.encode('utf-8').decode('unicode-escape')
>>> print(content)
---a---
---ä---


I'm getting now successfully 2 lines but I have noticed not getting the ä anymore. After that I have made a deeper look and opened this ticket.

If unicode_escape gets really deprecated maybe I could simply replace the characters 0-31 and 127 to achieve practically the same behavior.
History
Date User Action Args
2014-04-23 06:42:48Sworddragonsetrecipients: + Sworddragon, lemburg, ncoghlan, vstinner, ezio.melotti, r.david.murray
2014-04-23 06:42:48Sworddragonsetmessageid: <1398235368.19.0.430978418857.issue21331@psf.upfronthosting.co.za>
2014-04-23 06:42:48Sworddragonlinkissue21331 messages
2014-04-23 06:42:47Sworddragoncreate