title: Python - UnicodeEncodeError - encode('utf-8') with gspread in print fuction
body: <p>I am trying to run a gspread code, to print information from a google spreadsheet.
  The worksheet contains í, ú, and ó characters - which is the reason for the UnicodeEncodeError I get.</p>
  
  <p>I read the <a href="https://docs.python.org/2.7/howto/unicode.html" rel="nofollow noreferrer">Unicode HOWTO</a> and other sources which all tell you to use ".encode('utf-8')" or decode(), but don't know how to implement it in my case together with the print function. </p>
  
  <p>I tried things like:</p>
  
  <pre><code>#dsheet = sheet.encode('utf-8')
  </code></pre>
  
  <p>and</p>
  
  <pre><code># -*- coding: utf-8 -*-
  </code></pre>
  
  <p>which had no effect. </p>
  
  <p>I am using python 3 on MacOS.</p>
  
  <p>(The Code works I Removed all the UTF characters manual to see - I just want to know how to work out the encode in the future )</p>
  
  <p>The Code:</p>
  
  <pre><code>    # -*- coding: utf-8 -*-
  import gspread
  from oauth2client.service_account import ServiceAccountCredentials
  
  
  # use creds to create a client to interact with the Google Drive API
  scope = ['https://spreadsheets.google.com/feeds']
  creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
  client = gspread.authorize(creds)
  
  # Find a workbook by name and open the first sheet
  # Make sure you use the right name here.
  sheet = client.open("Legislators 2017").sheet1
  
  #dsheet = sheet.encode('utf-8')
  # Extract and print all of the values
  list_of_hashes = sheet.get_all_records()
  print(list_of_hashes)
  </code></pre>
  
  <p>The Errors:</p>
  
  <pre><code>------
  Traceback (most recent call last):
    File "spreadsheet.py", line 18, in &lt;module&gt;
      print(list_of_hashes)
  UnicodeEncodeError: 'ascii' codec can't encode character '\xed' in position 84066: ordinal not in range(128)
  ------
  Traceback (most recent call last):
    File "spreadsheet.py", line 18, in &lt;module&gt;
      print(list_of_hashes)
  UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 398608: ordinal not in range(128)
  -------
  -------
  </code></pre>