Python 3 unicode to utf-8 on file
问题 I am trying to parse through a log file, but the file format is always in unicode. My usual process that I would like to automate: I pull file up in notepad Save as... change encoding from unicode to UTF-8 Then run python program on it So this is the process I would like to automate in Python 3.4. Pretty much just changed the file to UTF-8 or something like open(filename,'r',encoding='utf-8') although this exact line was throwing me this error when I tried to call read() on it: