ajax| problem
Cause
There are 2 main reasons
1 xtmlhttp returned data The default character encoding is Utf-8, if the foreground page is gb2312 or other encoded data will produce garbled
2 Post method submission data The default character encoding is Utf-8, if the background is gb2312 or other encoded data will produce garbled
Solving method
Further finishing in
Recommended method, the foreground backstage all use Utf-8 code, this can save a lot of trouble, fundamentally solves the garbled problem. The advantage is high efficiency, and in line with the current form, Utf-8 coding itself is a relatively good coding, There is no language restriction. Disadvantages can only call their own background code or other UTF-8 encoding.
The foreground is changed to
Program code
The first line in the background ASP adds the following code
Program code
<% @LANGUAGE = "JAVASCRIPT" codepage= "65001"%>
<% response.charset= "Utf-8"; %>
<% session.codepage=65001; %>
Background If there is HTML code also need to guarantee
Program code
The remedy is to encode the conversion. The code conversion can also be done on the server side of the client. The advantage is that there is no limit, the disadvantage is inefficient.