Fix some encoding bug