httpclient 웹 페이지 내용 난자 질문 받기

최근에 몇 페이지를 기어다니다가 해석된 내용이 엉망이 됐어요. 마지막에 이 방법으로 엉망이 됐어요.
public static String getHTMLByDeCode(String url, String... params) throws Exception {
		DefaultHttpClient httpClient = new DefaultHttpClient();
		int index = 0;
		if(ipPortList.size() != 0){
			index = (int) (Math.random() * ipPortList.size() );
			String ipPort = ipPortList.get(index);
			if(!StringUtil.isEmpty(ipPort))
			{
				logger.debug(index+">>>"+ipPort);
				String[] ipPortResult = ipPort.split(":");
				HttpHost proxy = new HttpHost(ipPortResult[0], Integer.parseInt(ipPortResult[1]));//    ip
				httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
			}
		}
		HttpProtocolParams.setUserAgent(httpClient.getParams(),"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9");
		String charset = "UTF-8";
		if (null != params && params.length >= 1) {
			charset = params[0];
		}
		HttpGet httpget = new HttpGet();
		String content = "";
		try{
			httpget.setURI(new java.net.URI(url));
			HttpResponse response = httpClient.execute(httpget);
			HttpEntity entity = response.getEntity();
			if (entity != null) {
				//   EntityUtils toString  ,      , EntityUtils       ISO-8859-1
				content = EntityUtils.toString(entity, charset);
				httpget.abort();
				httpClient.getConnectionManager().shutdown();
			}
		}
		catch(Exception e){
			if(ipPortList.size() != 0)
				ipPortList.remove(index);
			
			e.printStackTrace();
			logger.debug("get proxy again!!!!");
			getHTMLByDeCode(url,params);
		}
		return content;
	}

참조 사이트 주소:
http://dh189.iteye.com/blog/732111
http://mhqawjh.iteye.com/blog/473450

좋은 웹페이지 즐겨찾기