Fix an encoding issue and set charset in the header