I have unicode-like strings, but with a slash. For example, '\\u000D' . I need to decode them like regular strings. The above example should be converted to '\r' , which corresponds to '\u000D' .
'\\u000D'
'\r'
'\u000D'
Use the unicode-escape codec.
unicode-escape
>>> import codecs >>> codecs.decode('\\u000D', 'unicode-escape') '\r'
Source: https://habr.com/ru/post/1013769/More articles:How to display asp.net mvc view in angular 2? - angularIs a template for defining a class inside a function acceptable? - pythonWhat is python _random? - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1013767/manually-changing-the-route-parameters-leads-to-inconsistent-user-interface&usg=ALkJrhjwwlCJomULFrRW7FIs8dF8kqt8zgHow to configure logging on dask distributed work resources? - daskAndroid - can mainThread handlers cause memory leaks? - androidWhat is the difference between Spring CGLIB and CGLIB? - javaChanging the color of text on a Google map marker marker - javascriptWhy do function calls incur overhead? - performanceThe actual interrupt handling mode is not working properly - assemblyAll Articles