code: def read_unicode_csv_fileobj(fileobj, delimiter=',', quotechar='"',
                               quoting=csv.QUOTE_MINIMAL, lineterminator='\n',
                               encoding='utf-8', skiprows=0):
      
      # Python 3 version
      if sys.version_info[0] >= 3:
          # Next, get the csv reader, with unicode delimiter and quotechar
          csv_reader = csv.reader(fileobj, delimiter=delimiter,
                                  quotechar=quotechar, quoting=quoting,
                                  lineterminator=lineterminator)
          # Now, return the (already decoded) unicode csv_reader generator
          # Skip rows if necessary
          for skip_ix in range(skiprows):
              next(csv_reader)
          for row in csv_reader:
              yield row
      # Python 2 version
      else:
          # Next, get the csv reader, passing delimiter and quotechar as
          # bytestrings rather than unicode
          csv_reader = csv.reader(fileobj, delimiter=delimiter.encode(encoding),
                               quotechar=quotechar.encode(encoding),
                               quoting=quoting, lineterminator=lineterminator)
          # Iterate over the file and decode each string into unicode
          # Skip rows if necessary
          for skip_ix in range(skiprows):
              next(csv_reader)
          for row in csv_reader:
              yield [cell.decode(encoding) for cell in row]
docs: fileobj can be a StringIO in Py3, but should be a BytesIO in Py2.