I have been reading quite a bit about encoding, and I'm still not sure I'm fully wrapping my head around it. I have a file encoded as ANSI with the word "Solluções" in it. I want to convert the file to UTF-8, but whenever I do it changes the characters.
Code:
with codecs.open(filename_in,'r')
as input_file,
codecs.open(filename_out,'w','utf-8') as output_file:
output_file.write(input_file.read())
Result: "Solluções"
I imagine this is a stupid problem, but I am at an impasse at the moment. I tried to call encode('utf-8') on the individual data in the file prior to writing it to no avail, so I'm guessing that's not correct either... I appreciate any help, thank you!