title: UnicodeEncodeError with Windows console in Python 3
body: <p>I've perused the other topics related to this question, but none have directly answered the question. I'm hoping that perhaps you all can help.</p>
  
  <p>I'm working on cleaning up a Wordpress Theme which has been long abused and uncleaned. We have about 10-12 CSS files that aren't being used. Just before I was going to delete them, I was told that some of the files may have been referenced in the actual content in the site. <em>Shudder</em> I'm using Python to search the line for the name of the file. If it finds the name, it renders the line from the file it was located, and the line in its entirety. Lastly it displays the end results and closes the files, etc. Here is the code. (Heads up... I'm not the most comfortable with Python.)</p>
  
  <pre><code>cssfile = open("css.txt", "r")
  s = open("berea.sql", "r", encoding="utf-8")
  
  totalfound = 0
  lineinfile = 0
  
  for filename in cssfile:
      for line in s:
          lineinfile = lineinfile+1
          for filename in line:
              print (lineinfile, line)
              totalfound = totalfound+1
      lineinfile=0
      if totalfound == 0:
          print ("No results were found for %s") % filename
      else:
          print ("We found %i of %s in the database") % (totalfound, filename)
  
  
  cssfile.close()
  searchfile.close()
  </code></pre>
  
  <p>Honestly, the biggest problem comes from the encoding error I receive.</p>
  
  <pre><code>UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position
  445: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>I've seen that adding different decodes, encodes, etc. should fix it, but nothing seems to work...  I would appreciate any and all assistance. I have about 349,000 lines to search through, and I keep getting stopped at 830.</p>