fix get encoding bug