HttpWebResponse字符集问题
很简单的一段代码,但是返回的字符集好像有问题,不知道什么原因,谁能给解释下,谢谢。
public static void Main(){ // Create a request for the URL. WebRequest request = WebRequest.Create(@"http://www.163.com"); // If required by the server, set the credentials. request.Credentials = CredentialCache.DefaultCredentials; // Get the response. HttpWebResponse response = (HttpWebResponse)request.GetResponse();//此处查看response的CharacterSet属性,为CharacterSet = "ISO-8859-1",而直接查看网页的源文件为<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> }