Alex Rivera | Logout

Characters in string changed after downloading HTML from the internet

Asked 2010-04-23T17:30:33.073
9

Using the following code, I can download the HTML of a file from the internet:

WebClient wc = new WebClient();

// ....

string downloadedFile = wc.DownloadString("http://www.myurl.com/");

However, sometimes the file contains "interesting" characters like é to é, ← to ↠and フシギダネ to フシギダãƒ.

I think it may be something to do with different unicode types or something, as each character gets changed into 2 new ones, perhaps each character being split in half but I have very little knowledge in this area. What do you think is wrong?

Edit
Report

1 Answer

-5

Try this

string downloadedFile = wc.DownloadString("http://www.myurl.com");

i allways remove the last "Slash" and it worked till now like a charm. But it could be also a coincidence

answered 2011-12-05T09:21:43.433

Your Answer