code: def strip_control_characters(data):
      if data:
          # unicode invalid characters
          re_xml_illegal = (
              "([\u0000-\u0008\u000b-\u000c\u000e-\u001f\ufffe-\uffff])|"
              "([%s-%s][^%s-%s])|([^%s-%s][%s-%s])|([%s-%s]$)|(^[%s-%s])"
              % (
                  chr(0xD800),
                  chr(0xDBFF),
                  chr(0xDC00),
                  chr(0xDFFF),
                  chr(0xD800),
                  chr(0xDBFF),
                  chr(0xDC00),
                  chr(0xDFFF),
                  chr(0xD800),
                  chr(0xDBFF),
                  chr(0xDC00),
                  chr(0xDFFF),
              )
          )
          data = re.sub(re_xml_illegal, "", data)
          # ascii control characters
          # data = re.sub(r"[\x01-\x1F\x7F]", "", data)
          # See:  http://w3.org/International/questions/qa-forms-utf-8.html
          # Printable utf-8 does not include any of these chars below x7F
          data = re.sub(r"[\x00-\x08\x0B\x0C\x0E-\x1F]", "", data)
      return data
  
imports: from subprocess import DEVNULL, PIPE, Popen
  from ..imports import *
label_desc: Use image node_id 8 for calling a global function with example usage: strip_control_characters(data) and returns: data