Make input classification more robust and handle UTF8 chords.