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