In .NET when I get a response stream from the server what type of encoding type should I use?
Posted
by
Max
on Stack Overflow
See other posts from Stack Overflow
or by Max
Published on 2010-12-22T17:40:49Z
Indexed on
2010/12/22
17:54 UTC
Read the original article
Hit count: 198
In the following example I m getting a response from the server; however do I need to set ASCII or UTF8 encoding type ?
Dim objURI As Uri = New Uri(URL)
Dim wReq As WebRequest = WebRequest.Create(objURI)
Dim wResp As WebResponse = wReq.GetResponse()
Dim respStream As Stream = wResp.GetResponseStream()
Dim reader As StreamReader = New StreamReader(respStream, Encoding.ASCII)
Dim respHTML As String = reader.ReadToEnd()
wResp.Close()
© Stack Overflow or respective owner