i am using
HttpClient.GetStringAsync(url)
to get the content of a webpage, and then get a certain tag's innerText. by default, the response is okay, but when the target webpage has the following metadata, it will cause messy code
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
so how can i know its charset and use it like this?
var byteData = await client.GetByteArrayAsync(url);
var Encoding.GetEncoding("name").GetString(byteData)