code: def decode_to_unicode(content):
      
      if content and not isinstance(content, str):
          try:
              # Try to decode ISO-8859-1 to unicode
              return content.decode("ISO-8859-1")
          except UnicodeEncodeError:
              # Assume content is unicode already
              return content
      return content
docs: decode ISO-8859-1 to unicode, when using sf api