PHP UrlEncode JavaScript decodeURI

Source: Internet
Author: User
In the Ajax development project, the inevitable need for character conversion operations, such as the server PHP UrlEncode code after the need for JavaScript parsing. At this point if you are using UTF-8 encoding then you will not encounter the problem of parsing, but if you use other code (GB2312 etc) directly with the JS decodeURI parsing code, will error. What is this for? The original JavaScript parsing is utf-8 encoding, and then passed over the non-utf-8 (gb2312) encoding. Well, find out the reason is better solved, first in the server side of the Code conversion iconv (' gb2312 ', ' utf-8 ', ' Your string '), then use JS analysis to try ^_^

Keep a record of the problems you have encountered.

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