refactoring: hide the charlist implementation of InputText
This patch also fix #875.