simplify charset handling