title: Python/Tweepy UnicodeEncodeError
body: <p>I am trying to scrape through Twitter bios using the Twitter API with Python. </p>
  
  <p>However I get this error:</p>
  
  <blockquote>
    <p>newFile.writerow(info)<br>
    UnicodeEncodeError: 'ascii' codec can't
    encode characters in position 0-4: ordinal not in range(128)</p>
  </blockquote>
  
  <p>I assume this occurs when someone has an emoji in their bio or screen name, however none of the following solutions seem to stop the error:</p>
  
  <ul>
  <li>.encode('unicode_escape') </li>
  <li>.encode('UTF8') </li>
  <li>.encode('UTF-8')</li>
  </ul>
  
  <p>Here is the current code</p>
  
  <pre><code>for follower in followers.items():
      info=[]
      name =follower.name.encode('unicode_escape')
      screen_name = follower.screen_name.encode('unicode_escape')
  
      userId = userId + 1
  
      #add values to array
      values.append(userId)
      values.append(name)
      values.append(screen_name)
  
      csvFile = open('followers.csv','a')
      newFile =csv.writer(csvFile) #imported csv
      #add list of headers as a new row
      newFile.writerow(info)
      #close file
      csvFile.close()
  </code></pre>