"Remarks" & # x; format encoding conversion,
On many websites (or many WebServices ),
We can always see & #1234; & # A22A; encoding in this format.
C # code:
1 // various moth web page icons see: https://dev.w3.org/html5/html-author/charref 2 3 string str = "& #20013; & #22269;"; 4 string str2 = "& # x4e2d; & # x56fd; "; 5 string str3 =" & clubs; & clubsuit; & # x02663; & #9827; & #9608; "; 6 7 8 string decode = System. web. httpUtility. htmlDecode (str); 9 Console. writeLine (decode); // China 10 decode = System. web. httpUtility. htmlDecode (str2); 11 Console. writeLine (decode); // China 12 decode = System. web. httpUtility. htmlDecode (str3); 13 Console. writeLine (decode );//♣& Clubsuit;♣♣Other // some & clubsuit; formats cannot be identified. 14 15 Console. writeLine (System. web. httpUtility. htmlEncode ("I love China"); // it will not be escaped again as & #0000; format
Last nonsense:
> & #2222; this encoding is used for UTF8 webpage encoding.
> This type of encoding and & nbsp; & lg; & tg; are basically a group of codes.
> But: & #2222; this type of code has no value for visual testing.