I have a Unicode escaped string:
> str = 'blah\\x2Ddude'
I want to convert this string to Unicode Unesced version of 'blah-dude'
'blah-dude'
How can I do it?
Encode it to bytes (using any codec, utf-8 may work), then decode it with unicode-escape :
bytes
unicode-escape
s = 'blah\\x2Ddude' s.encode().decode('unicode-escape') Out[133]: 'blah-dude'
Source: https://habr.com/ru/post/1259378/More articles:AFNetworking problem with answer: unauthorized (401) - jsonDo primitive values ββneed to be nullified to collect collectors? - javascriptHow to hide keyboard with one touch outside edittext? - androidCSVremove escape character from string - pythonHow to add "%" to data in ios-chart - swiftHow to show percent sign in a pie chart using daniel gindi / Chart library in swift (IOS chart) - iosHow to limit consumption from the topic? - amazon-s3How is each dynamically verified aspect of Rust implemented? - rustHas anyone seen a warning: target indicates SWIFT_VERSION = '2.3' - iosAll Articles