Error writing a file with file.write in Python. UnicodeEncodeError
问题 I have never dealt with encoding and decoding strings, so I am quite the newbie on this front. I am receiving a UnicodeEncodeError when I try to write the contents I read from another file to a temporary file using file.write in Python. I get the following error: UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 41333: ordinal not in range(128) Here is what I am doing in my code. I am reading an XML file and getting the text from the "mydata" tag. I then iterate