3 ms·
The OP links to StackOverflow, where failing inputs are mentioned in the comments on the accepted answer. And the second-most upvoted answer explains that .deco
by yorwba 8y ago
The OP links to StackOverflow, where failing inputs are mentioned in the comments on the accepted answer. And the second-most upvoted answer explains that .decode('unicode_escape') only works for Latin-1 encoded text: https://stackoverflow.com/a/24519338 https://stackoverflow.com/a/24519338
- lozenge 8y agoThe question being how to parse character escapes (backslash sequences) in Python. To be honest, you could write a custom character-by-character parser easily or even use the regex module.
- burntsushi 8y agoBut the OP has their own problem with which they posted a solution, but didn't include the actual problematic program.