fix the input encoding problem