Jun-11-2019, 05:03 PM
My Python 2.7.10 code (in MacOS 10.14.5) replaces letters with accents such as á with strings such as \xc3\xa1. Letters display with accents in both my text file (in TextEdit) of Portuguese words and my (Mac) Terminal, both of which are encoded in Unicode (UTF-8). I've searched online and tried various things but nothing works.
This is my code:
This is my code:
f = open(filename,"r") filelist = list(f) n = filename + "_As_List" l = open(n,"w") print(filelist) l.write(str(filelist))How can I get letters with accents to display in the outputs of that code?