fix res.charset appending charset when exists