private String getContentCharset(URLConnection connection) {
		String contentType = connection.getContentType();
		if (contentType == null) {
			return DEFAULT_CONTENT_CHARSET;
		}
		String charset = null;
		for (String param : contentType.replace(" ", "").split(";")) {
			if (param.startsWith("charset=")) {
				charset = param.split("=", 2)[1];
				break;
			}
		}
		return (charset != null) ? charset : DEFAULT_CONTENT_CHARSET;
	}