I have a utf8 file. When I read it's values python throws some exceptions so that I need to encode retrieved values. Then I save that value to redis, retrieve it later and store in another file. However I do not get to see nice file output that is readable. All "special" unicode characters come as e.g. Kj\xf8s or Kj\u00f8s
How can I fix this so that file becomes human readable :)
Thanks!
# pseudocode
file = codecs.open(filename,'r', 'utf-8')
for line in file:
value = line.encode('utf-8')
store_value_in_redis(value)
v = retrieve_value_from_redis()
file = codecs.open(filename2,'w', 'utf-8')
# Tried but did not help:
file.write(v)
file.write(v.decode('utf-8'))