The get method is garbled and the post method is not garbled.

Source: Internet
Author: User

The data set of the get restriction form is ASCII code.

While post supports the entire iso000046 character set, the default is to use ISO-8859-1

If the declared method not displayed in the form is post, the default value is get.

 

The International Standard ISO 10646 defines the general character set UCS. UCOS is a superset standard for all other character sets. it ensures bidirectional compatibility with other character sets. that is to say, if you translate any text string to the ucsformat and then translate it back to the original encoding, you will not lose any information.

Iso000046 also contains GBK and other character sets, so the POST method will not contain garbled characters.

The get method only contains the ASCII character set, so garbled characters are involved.

The get method must be processed.

 

1. Processing Method in JS

Url = encodeuri (URL );

Java processing method java.net. urldecoder. Decode (request. getparameter ("name"), "UTF-8 ");

 

2. Tomcat processing method

Server. xml

Set under connector Element
Uriencoding = "UTF-8"

 

The get method is garbled and the post method is not garbled.

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.