"Remarks" & amp; # x; format encoding conversion,

Source: Internet
Author: User

"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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.