You can directly request the webpage through webbrowser. The webpage is displayed normally. You can obtain the string and then use navigatetostring () to display garbled characters.
Convert Chinese to unicode encoding:
Public static string unicode2html (string HTML)
{
Stringbuilder STR = new stringbuilder ();
Char C;
For (INT I = 0; I
{
C = html [I];
If (convert. toint32 (c)> 127)
{
Str. append ("& #" + convert. toint32 (c) + ";");
}
Else
{
Str. append (C );
}
}
Return Str. tostring ();
}
Private void renderpage ()
{
VaR html = fxconstants. articleviewtemplate
. Replace ("{Article-header}", _ selectedrssitem. Title)
. Replace ("{Article-content}", _ content)
. Replace ("{background-specific-style }",
Phoneui. currentphonebackground = phonebackground. Dark
? FX. instance. settings ["Article-View-darkbackground-CSS"]
: FX. instance. settings ["Article-View-lightbackground-CSS"])
. Replace ("{common-style}", FX. instance. settings ["Article-View-CSS"]);
Html = unicode2html (HTML );
Browser. navigatetostring (HTML );
}