fix some encoding bug