I have a plain text file with this content:
Test: \u0410\u0412\u0422\u041e
I try to read that file in python and print the characters in unicode like this:
import codecs
f = codecs.open('b.txt', encoding='utf-8')
for line in f:
print line
Output:
Test: \u0410\u0412\u0422\u041e
I was expeting this text:
Test: ABTO
“Test” following the cyrilic word for STOP.
You have an ascii file with unicode escape sequence; of the form
\u0410...we have to convert it to the form\\u0410....so that we can apply decode function as follows.