private static String getContentCharSet(final HttpEntity entity) throws ParseException {
        if (entity == null) {
            throw new IllegalArgumentException("HTTP entity must not be null");
        }
        String charset = null;
        if (entity.getContentType() != null) {
            HeaderElement values[] = entity.getContentType().getElements();
            if (ArrayUtils.hasLength(values)) {
                NameValuePair param = values[0].getParameterByName("charset");
                if (param != null) {
                    charset = param.getValue();
                }
            }
        }
        return charset;
    }
copy: EntityUtils Obtains character set of the entity, if known.

@param entity must not be null
@return the character set, or null if not found
@throws ParseException           if header elements cannot be parsed
@throws IllegalArgumentException if entity is null
agent-module/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4EntityExtractor.java