C# – Handling symbols in webbrowser control

When we handle symbols like Ø,½ and ± in C#.net with the webBrowser
we will face some incompatibility issues even if we set a corresponding character encoding for the browser control . In order to overcome this issue we can get the header details and body details separately
instead of using the documenttext .

The code can be written as below,

string strhead = webBrowser1.Document.GetElementsByTagName(“head”)[0].OuterHtml;
string strbody = webBrowser1.Document.Body.OuterHtml;
string strhtml = strhead + strbody;

Posted in c# Tagged with: ,