code: protected Charset getCharSet() {
  		String contentType = urlConnection.getContentType();
  		Charset charset = Charset.forName("iso-8859-1"); // default charset
  		if (contentType != null) {
  			// find out about the charset from the URLConnection
  			Matcher m = charsetPattern.matcher(contentType);
  			if (m.find()) {
  				String charsetString = m.group(1);
  				try {
  					charset = Charset.forName(charsetString);
  				} catch (IllegalCharsetNameException e) {
  					e.printStackTrace();
  				} catch (IllegalArgumentException e) {
  					e.printStackTrace();
  				}
  			}
  		}
  		return charset;
  	}
docs: Get charset for this content type. Parses charset= attribute of content
  type or falls back to a default
  
  @return the charset to use when parsing this content