I have troubles to understand how encodings works:
Why strings inside python code can be encoded:
s = 'Au\xc3\x9fenformat\n'
print s.encode('utf-8')
>>>Außenformnat
But if I read such a string from a text file I get:
f = open('out.txt', 'r')
data = f.read()
print data.encode('utf-8')
>>>Au\xc3\x9fenformat\n
Any suggestions?
sqlite3module handles Unicode fine, but verify the module documentation to be sure you didn't accidentally misconfigure things.cat out.txt?