title: Scrapy - encoding csv file utf-8
body: <p>I looked all over this website, I did the same on google but I found nothing about exporting the data in a csv file encoding utf-8. </p>
  
  <p>I need to encode my file because I have some french characters (like É).
  I use CsvItemExporter, which is normally already encode in utf-8 but it doesn't give me the correct characters. Instead of these char, I only have some weird things like \A4ybzkzv and I don't know how to have the correct ones.</p>
  
  <p>I hope I have been clear enough!! Thank you for your help...</p>
  
  <p>Here is my pipelines.py :</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from scrapy import signals
  from scrapy.exporters import CsvItemExporter
  
  # Define your item pipelines here
  #
  # Don't forget to add your pipeline to the ITEM_PIPELINES setting
  # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
  
  # Define your output file.
  class FnacPipeline(CsvItemExporter):
      def __init__(self):
          self.files = {}
  
      @classmethod
      def from_crawler(cls, crawler):
          pipeline = cls()
          crawler.signals.connect(pipeline.spider_opened, signals.spider_opened)
          crawler.signals.connect(pipeline.spider_closed, signals.spider_closed)
          return pipeline
  
      def spider_opened(self, spider):
          f = open('..\\..\\..\\..\\Fnac.csv', 'w').close()
          file = open('..\\..\\..\\..\\Fnac.csv', 'w')
          self.files[spider] = file
          self.exporter = CsvItemExporter(file)
          self.exporter.start_exporting()
  
      def spider_closed(self, spider):
          self.exporter.finish_exporting()
          file = self.files.pop(spider)
          file.close()
  
      def process_item(self, item, spider):
          self.exporter.export_item(item)
          return item
  </code></pre>
  
  <p>With this pipeline, I have an error and not the right characters : <code>TypeError: must be str, not bytes</code> and when I change <code>file = open('..\\..\\..\\..\\Fnac.csv', 'w')</code> to <code>file = open('..\\..\\..\\..\\Fnac.csv', 'wb')</code>, I have no more error but not the right char...</p>
  
  <p>The output I have :
  <code>France mÃ©tropolitaine</code></p>
  
  <p>The output I want :
  <code>France métropolitaine</code></p>