I need to convert my html file that is in charset = iso-8859-1 to UTF-8, could you help me?
this is my code:
string converHtml = File.ReadAllText(html);
Encoding iso = Encoding.GetEncoding("windows-1252");
Encoding utf8 = Encoding.UTF8;
byte[] isoBytes = iso.GetBytes(converHtml);
byte[] utf8Bytes = Encoding.Convert(utf8, iso, isoBytes);
string msg = utf8.GetString(utf8Bytes);
msg = HttpUtility.HtmlDecode(msg);
return msg;