fix bugs of character encoding