handle unicode input strings properly