input: handle UTF-8 terminal input