string encoding and decoding from possibly latin1 and utf8,print(str.encode('cp1252').decode('utf-8').encode('cp1252').decode('utf-8'))