Fixed the problems with character encoding.