code: protected Charset guessContentTypeCharset(final HttpURLConnection connection) {
  		String contentType = connection.getHeaderField(CONTENT_TYPE_HEADER);
  		if (contentType == null) {
  			return UTF8;
  		}
  
  		String charset = null;
  		for (String param : contentType.replace(" ", "").split(";")) {
  			if (param.startsWith("charset=")) {
  				charset = param.split("=", 2)[1];
  				break;
  			}
  		}
  
  		try {
  			return Charset.forName(charset);
  		} catch (Exception e) {
  			return UTF8;
  		}
  	}
docs: Returns a charset from the content type header or UTF8.