Reputation: 34180
WebClient wc = new WebClient();
wc.Encoding= System.Text.Encoding.UTF8;
wc.DownloadStringAsync(new Uri("http://example.com/test.html"));
What am I doing wrong here?
Upvotes: 1
Views: 1092
Reputation: 49
This worked for me:
using (var client = new WebClient())
{
client.Encoding = System.Text.Encoding.UTF8;
client.Headers.Add(HttpRequestHeader.AcceptCharset, "UTF-8");
client.DownloadStringAsync(uri);
//Do-Something
}
Upvotes: 0
Reputation: 51
Try this?
wc.Headers.Add(HttpRequestHeader.AcceptCharset, "UTF-8");
Upvotes: 1