Open the source code of componentart,
The accepted characters of componentart are encoded according to encode. Default, that is, the default encoding is used. We can change to UTF-8.
For example:
Protected void loadclientdata (string sdata)
{
String tempdata = sdata; // cache receiving characters
Try
{
If (sdata! = String. Empty)
{
This. nodes. Clear ();
Sdata = httputility. urldecode (sdata, encoding. Default );
// Make it XML-safe
Sdata = sdata. Replace ("&", "# $ camp @*");
Xmldocument oxmldoc = new xmldocument ();
Try {
Oxmldoc. loadxml (sdata );
}
Catch {
Sdata = httputility. urldecode (httputility. urldecode (tempdata, encoding. utf8 ));
Oxmldoc. loadxml (sdata); // do not change the originalCodeIn the catch, the value is UTF-8 encoded again.
}
Xmlnode orootnode = oxmldoc. documentelement;
If (orootnode! = NULL & orootnode. childnodes. Count> 0)
{
This. loadclientxmlnodes (orootnode. childnodes,-1, this. nodes );
// Fix up pointers
This. componentartfixstructure ();
}
}
}
Catch (exception ex)
{
Throw new exception ("error loading client data:" + ex );
}
}
The above Code comes from
basenavigator. CS has about 1400 rows.