title: Python 3 CSV file giving UnicodeDecodeError: 'utf-8' codec can't decode byte error when I print
body: <p>I have the following code in Python 3, which is meant to print out each line in a csv file.</p>
  
  <pre><code>import csv
  with open('my_file.csv', 'r', newline='') as csvfile:
      lines = csv.reader(csvfile, delimiter = ',', quotechar = '|')
      for line in lines:
          print(' '.join(line))
  </code></pre>
  
  <p>But when I run it, it gives me this error:</p>
  
  <pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 7386: invalid start byte
  </code></pre>
  
  <p>I looked through the csv file, and it turns out that if I take out a single ñ (little n with a tilde on top), every line prints out fine. </p>
  
  <p>My problem is that I've looked through a bunch of different solutions to similar problems, but I still have no idea how to fix this, what to decode/encode, etc. Simply taking out the ñ character in the data is NOT an option. </p>