System encoding dependent bug fix