Question about ajax Chinese Encoding

Source: Internet
Author: User

Question about ajax Chinese Encoding
The get request and post request are scored in two different ways to solve the problem: Why does get request 1 generate garbled Characters? IE browser uses gbk for encoding, while other browsers use UTF-8 for encoding, the server is to use the iso-8859-1 to decode 2 how to solve the first server on the server side to open the server under the conf folder of the server. in the xml file, find the <connector URIEncoding = "UTF-8"> tag and add it to the tag. Second, use the encodeURI function on the request end to encode the request. Xhr. open ('get', encodeURI (check_name? Username = username), true); why does post request 1 generate garbled browsers are encoded with UTF-8, and the server uses iso-8859-1 to decode 2 how to solve the problem of using request in servlet. setCharacterEncoding ("UTF-8") to decode response. setContentType ("text/html; charset = UTF-8") to encode

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.