Download html page with correct web client encoding

I load the page with the encoding: "usa-ascii", but I'm wrong. why??

WebClient wb = new WebClient();
Encoding enc = Encoding.GetEncoding("US-ASCII");
wb.Encoding = enc;
byte[] by = wb.DownloadData(link);
string htmlDoc = enc.GetString(by);

but I get: Pr? z instead of: Präz .

Html of my link : (charest = us-ascii)

<html debug="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/>
</head>
...................

What's wrong???

ps I tried utf-8 encoding and it didn't work either.

+3
source share
1 answer

US-ASCII does not have this character, so the page contains an invalid character (for a specific encoding). Your code is not mistaken, the problem is that US-ASCII is not enough for characters like ä.

US-ASCII Data Table: Link

+2
source

All Articles