How to deal with garbled URLs in URL URLs

Source: Internet
Author: User
Recently wrote a program in PHP (UTF8 encoding) found that the HTTP get to send an odd number of Chinese characters to the server side will appear garbled, just beginning to think PHP program or service configuration problems.

Later checked for a half-day discovery is not, in Google search to see someone said is IE6 there is a compatibility problem, ie7,ie8,firefox,chrome do not have this problem.

The workaround for this problem is simple, just use urlencode encoding for processing, and note that if you are using JavaScript-passed parameters, you are using the encodeURI function.

In fact, this should be a habit of the problem, for all get pass parameters are urlencode processing, will make the program appear more robust, compatibility, portability is better.

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