def CheckForBadCharacters(filename, lines, error):
 for (linenum, line) in enumerate(lines):
  if (unicode_escape_decode('\\ufffd') in line):
   error(filename, linenum, 'readability/utf8', 5, 'Line contains invalid UTF-8 (or Unicode replacement character).')
  if ('\x00' in line):
   error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.')

def CheckForBadCharacters ( filename , lines , error ) : for ( linenum , line ) in enumerate ( lines ) : if ( unicode_escape_decode ( '\\ufffd' ) in line ) : error ( filename , linenum , 'readability/utf8' , 5 , 'Line contains invalid UTF-8 (or Unicode replacement character).' ) if ( '\x00' in line ) : error ( filename , linenum , 'readability/nul' , 5 , 'Line contains NUL byte.' )
logs an error for each line containing bad characters .