[問題] HttpWebRequest抓雅虎網頁 中文字無法出現
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse webresponse = (HttpWebResponse)req.GetResponse();
Stream stream = webresponse.GetResponseStream();
StreamReader streamreader = new StreamReader(stream,
Encoding.GetEncoding("ISO-8859-1"));
String html = streamreader.ReadToEnd();
/*
url為雅虎網域,如下
http://tw.search.yahoo.com/search?p=%E6%B8%AC%E8%A9%A6&fr=yfp&ei=utf-8&v=0
html 當中的中文字都無法出現(不是亂碼,而是沒有中文字),其他都正常
請教各位先進 謝謝
*/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.125.46.68
→
02/24 15:16, , 1F
02/24 15:16, 1F
→
02/24 15:18, , 2F
02/24 15:18, 2F
→
02/24 18:05, , 3F
02/24 18:05, 3F
→
02/24 18:06, , 4F
02/24 18:06, 4F
→
02/24 18:07, , 5F
02/24 18:07, 5F
→
02/24 18:07, , 6F
02/24 18:07, 6F
→
02/24 20:04, , 7F
02/24 20:04, 7F
→
02/24 20:04, , 8F
02/24 20:04, 8F
→
02/24 20:06, , 9F
02/24 20:06, 9F
→
02/25 01:04, , 10F
02/25 01:04, 10F