Improve formats handler to match jsom mimetype with charset.