Chinese processing of forms of forms a fault handler

xiaoxiao2021-03-06  21

Chinese processing of forms of forms a fault handler

I have been worried again if I have already solved the problem. It is really an unpleasant thing. Maybe I have more understanding of the cause of the problem, or in different situations.

When you submit processes in form, we most use the Request.SetCharacterencoding ("GB2312) method, or use the servlet's Filter filtering settings to process the submission of Chinese forms. It should be noted that the use of this method must be used before request.getParameter. Otherwise, there is a different impact on the results you need:

In Apache Tomcat /

4.1.27

Below, the character set setting is invalid. The characters are still garbled, no normal conversion.

Weblogic

7.0.5

.0 below, some normal, no abnormal phenomenon.

Refer to JSP.

<% @ page language = "java" contenttype = "text / html; charset = GB2312"%> <% string string = request.getParameter ("id"); Request.setCharacterencoding ("GB2312"); string strname = Request.getParameter ("name"); system.out.println ("strname is:" strname);%> this is my jsp page.