以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  网页是GBK,怎么转为UTF8?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=84059)

--  作者:sjzsdu
--  发布时间:2016/4/22 11:30:00
--  网页是GBK,怎么转为UTF8?

Dim web As new windows.forms.webbrowser
web.Navigate(“https://s.1688.com/selloffer/-CAFDC2EBD3A1BBA8-1046457.html?spm=b26110380.sw0.0.0.pfGSFx&cps=1&n=y&uniqfield=pic_tag_id”)
Do Until web.ReadyState = 4
    Application.DoEvents
Loop
Dim str As String = web.documentText

网页上的是GBK格式的,得到的文本是乱码,怎么转换格式为UTF-8

--  作者:大红袍
--  发布时间:2016/4/22 11:37:00
--  

Dim web As new windows.forms.webbrowser
web.Navigate("https://s.1688.com/selloffer/-CAFDC2EBD3A1BBA8-1046457.html?spm=b26110380.sw0.0.0.pfGSFx&cps=1&n=y&uniqfield=pic_tag_id")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop

Dim getReader = new System.IO.StreamReader(web.DocumentStream, Encoding.Default)
Dim str = getReader.ReadToEnd()
output.show(str)