About the% hexadecimal number in the URL how the server resolves

Source: Internet
Author: User
Just think of the hidden URL of the% hexadecimal number, read some asked what to use this encoding solution, this is clear. It is said online to be compatible with some devices that only support ASCII code. I feel this explanation is a bit far-fetched, everyone think ...

My doubts are: for such a hexadecimal number, the server is how to parse such a URL. How does the server determine what encoding this hexadecimal number represents?
%b7%fe%ce%f1%c6%f7%c8%e7. Like such a string, how the server resolves whether it is UTF8 encoded or GBK or GB2321 ...


Reply to discussion (solution)

UrlDecode
The coding of UTF-8 and GBK is differentiated from signature to identification.

Can you explain in detail what the difference is?

URL encoding, which will be decoded by the Web server's implicit execution UrlDecode
As for what is passed, it needs to be interpreted by the application

This is not related to the server. is the browser interpretation code, to unify the same urlencode processing it. Guess, a water doll.

nn. Understanding the application is a problem. But still do not know how to determine the encoding format: Another question, like this code, in the client should be implemented with JS, to the background with the background code parsing, which means that the two ends of the coding to be unified, this is not difficult to do, or the problem, how to determine what code?

Different browsers, in the URL address of the Chinese language, there will be different results. Some are GBK, some are UTF-8, in order to prevent the inconvenience caused by the automation of the browser, the Chinese most first to use urlencode processing, the receiving end with UrlDecode to deal with.
PHP has a method for detecting character sets, but it is not very accurate and should not be overly desired.

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