title: Python read csv - BOM embedded into the first key
body: <p>I'm using Python 2.7.12. With this code snippet I'm saving a utf-8 csv file. I wrote the BOM (<a href="https://en.wikipedia.org/wiki/Byte_order_mark" rel="noreferrer">byte order mark</a>) at the beginning of the file.</p>
  
  <pre><code>import codecs
  import csv
  
  outputFile = open("test.csv", "wb")
  outputFile.write(codecs.BOM_UTF8)
  fieldnames = ["a", "b"]
  writer = csv.DictWriter(outputFile, fieldnames, delimiter=";")
  writer.writeheader()
  row = dict([])
  for i in range(10):
      row["a"] = str(i).encode("utf-8")
      row["b"] = str(i*2).encode("utf-8")
      writer.writerow(row)
  outputFile.close()
  </code></pre>
  
  <p>I want to load that csv file:</p>
  
  <pre><code>import codecs
  import csv
  inputFile = open("test.csv", "rb")
  reader = csv.DictReader(inputFile, delimiter=";")
  for row in reader:
      print row["a"]
  inputFile.close()
  </code></pre>
  
  <p>The above code is going to fail: <code>KeyError: 'a'</code>
  If I print the row keys this is how they look: <code>[u'\ufeffa', u'b']</code>. The BOM has been embedded into the key <code>a</code>. What am I doing wrong?</p>