chacter encode fix