The difference between Urlencoder.encode and encodeURIComponent in Java

Source: Internet
Author: User

Background information:

1) encodeURIComponent and decodeuricomponent used in front

2) Urlencoder.encode and Urldecoder.decode used in the background

Knowledge Points:

1) The difference between encodeURIComponent and Urlencoder.encode is that the former does not encode the following five symbols

! %21   
'%27   
(%28   
)%29   
~%7e

2 decodeURIComponent and Urldecoder.decode can not see the difference for a while

Explain:

Before and after the interactive transmission of data in the process, if it contains! ' () ~, the same content will transmit different coding results, but each other can decode. In the specific application, if there is a comparison of the logic before and after the code, it is best to measure these symbols. If the programming environment is the best solution to this problem, you might want to think about patching.

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.