fix charset validation