Question about unicode encoding

Source: Internet
Author: User
Ask a unicode encoding question. js has a function String. charCodeAt that converts a character at the specified position of a String to unicode encoding and returns a number. Now I want to convert a website such as http://bbs.csdn.net/into a unicodecharacter string. I want to use the PHP letter to ask a question about unicode encoding.
The String. charCodeAt function in js can convert characters at the specified position of a String to unicode encoding and return a number. Now I want to set a URL, such as ingress? After searching for Chinese characters on the Internet for a long time, I found that they are converted to unicode encoding. All I want is to convert English letters and symbols! Share:
------ Solution --------------------
For basic ASCII characters only, you only need to use the ord function.
If it contains Chinese characters, iconv function transcoding is available, the target character set is UCS-2
However, it should be noted that in the UCS-2 character set, the basic ASCII character is also 2 bytes

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.