code: def strencode(instr, encoding="utf-8"):
      try:
          instr = instr.encode(encoding)
      except (UnicodeDecodeError, AttributeError):
          pass
      return instr
  
label_desc: Use image node_id 1 for calling a global function with example usage: strencode(instr, encoding) and returns: instr