code: def _validate_xtext(xtext):
      
  
      non_printables = _non_printable_finder(xtext)
      if non_printables:
          xtext.defects.append(errors.NonPrintableDefect(non_printables))
      if utils._has_surrogates(xtext):
          xtext.defects.append(errors.UndecodableBytesDefect(
              "Non-ASCII characters found in header token"))
docs: If input token contains ASCII non-printables, register a defect.