should support wide (accented) chars. Needs testing.