SmartUpload中文乱码

SmartUpload中文乱码的解决办法:

1、源代码相关:

---------------------------------------------------------------------------------------------------------------------

找到SmartUpload.java中的    public void upload(),找到这句 String s11 = new String(m_binArray, m_startData, (m_endData - m_startData) + 1);

修改为String s11 = new String(m_binArray, m_startData, (m_endData - m_startData) + 1,"UTF-8");   
---------------------------------------------------------------------------------------------------------------------

把formdata.jsp中<%@ page contentType="text/html;charset=gb2312">,取掉,加上<meta http-equiv="Content-Type" content="text/html; charset=gb2312">,

2、其他解决办法:

SmartUpload源代码由于是因为以二进制的形式传输,所以在传输form表单中的文本的时候,不能象普通的传输方法那样传输。好办法就是使用javascript把这些值都附加到form的action里面进行传输。比如:

if(checkreg()) {
        document.form1.action="../AddNewUserServlet?name="+form1.UserName.value+"&&eid="+form1.EmployeeID.value+"&&pwd="+form1.Password.value+"&&sid="+form1.SectorID.value+"&&gid="+form1.GroupID.value;
        document.form1.submit();    
        } 

 

你可能感兴趣的:(JavaScript,html,jsp)