public static String parseByResHeader(String urlStr) {
		
		String charset = null;
		//ȡҳʽ
		String regex_charset = "text/html;[ ]{0,1}[Cc]harset=(.*)";
		//Java̻
		URL url;
		try {
			url = new URL(urlStr);
			HttpURLConnection httpURLConn = (HttpURLConnection) url.openConnection();
			charset = httpURLConn.getContentType();
			System.out.println(charset);
			if (charset != null) {
				if (!charset.equals("text/html")) {
					Pattern p_charset = Pattern.compile(regex_charset,
							Pattern.DOTALL);
					Matcher m_charset = p_charset.matcher(charset);
					while (m_charset.find()) {
						charset = m_charset.group(1).toLowerCase();
					}
				} else {
					return Decoder.parseByContent(urlStr);
				}
			} else {
				return Decoder.parseByContent(urlStr);
			}
	
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}