现在的位置: 首页 > 综合 > 正文

jsp/servlet 乱码解决小方法

2013年10月14日 ⁄ 综合 ⁄ 共 264字 ⁄ 字号 评论关闭

import java.io.UnsupportedEncodingException;

        String s1 = (String)request.getParameter("txtcondition");

        try { 

            s1 = new String(s1.getBytes("ISO-8859-1"),"GB2312"); 
 
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }

抱歉!评论已关闭.