def _has_non_ascii_characters(data_string):
 try:
  data_string.encode('ascii')
 except UnicodeEncodeError:
  return True
 return False

def _has_non_ascii_characters ( data_string ) : try : data_string . encode ( 'ascii' ) except UnicodeEncodeError : return True return False
check if provided string contains non ascii characters .