Fix the CharsetEncoder bug