public static String getCharset(String page)
	{
		// 
		page = page.toLowerCase(Locale.getDefault());
		int charsetIndex = page.indexOf("charset=");
		Pattern pattern = Pattern.compile("[a-z0-9/-]{1}");
		
		// 如果不存在charset=
		if (charsetIndex < 0)
		{
			return "utf-8";
		}
		
		// 截取掉字符集前的所有字符
		String indefiniteCharset = null;
		String symbol = page.substring(charsetIndex + 8, charsetIndex + 9);
		if (!pattern.matcher(symbol).matches())
		{
			indefiniteCharset = page.substring(charsetIndex + 9);
		}
		else
		{
			indefiniteCharset = page.substring(charsetIndex + 8);
		}
		
		// 读取字符集
		StringBuffer charset = new StringBuffer();
		for (int i = 0; i < indefiniteCharset.length(); i++)
		{
			if (!pattern.matcher(indefiniteCharset.substring(i, i + 1)).matches())
			{
				break;
			}
			
			charset.append(indefiniteCharset.substring(i, i + 1));
		}
		return charset.toString();
	}