fix config charset with a function