def string_to_intlist(text):
 try:
  return [ord(c) for c in text.encode('utf-8')]
 except (UnicodeEncodeError, UnicodeDecodeError):
  return [ord(c) for c in text]

def string_to_intlist ( text ) : try : return [ ord ( c ) for c in text . encode ( 'utf-8' ) ] except ( UnicodeEncodeError , UnicodeDecodeError ) : return [ ord ( c ) for c in text ]
converts a string into an array of integers .