Improve ContentType charset parsing, close #2232