code: def force_text(s, encoding='utf-8', errors='strict'):
      
      if isinstance(s, text_type):
          return s
  
      try:
          if not isinstance(s, string_types):
              if PY3:
                  if isinstance(s, bytes):
                      s = text_type(s, encoding, errors)
                  else:
                      s = text_type(s)
              elif hasattr(s, '__unicode__'):
                  s = s.__unicode__()
              else:
                  s = text_type(bytes(s), encoding, errors)
          else:
              s = s.decode(encoding, errors)
      except UnicodeDecodeError as e:
          if not isinstance(s, Exception):
              raise FlaskMailUnicodeDecodeError(s, *e.args)
          else:
              s = ' '.join([force_text(arg, encoding, errors)
                            for arg in s])
      return s
docs: Similar to smart_text, except that lazy instances are resolved to
      strings, rather than kept as lazy objects.
  
      If strings_only is True, don't convert (some) non-string-like objects.