code: def guess_decode(text):
      """Decode *text* with guessed encoding.
  
      First try UTF-8; this should fail for non-UTF-8 encodings.
      Then try the preferred locale encoding.
      Fall back to latin-1, which always works.
      """
      try:
          text = text.decode("utf-8")
          return text, "utf-8"
      except UnicodeDecodeError:
          try:
              import locale
  
              prefencoding = locale.getpreferredencoding()
              text = text.decode()
              return text, prefencoding
          except (UnicodeDecodeError, LookupError):
              text = text.decode("latin1")
              return text, "latin1"
  
imports: import re
  from io import TextIOWrapper
label_desc: Use image node_id 14 for calling a global function with example usage: guess_decode(text) and returns: text,  str, text,  prefencoding, text,  str