String str = new String(str.getBytes("iso-8859-1"), "gb2312");

解决方案 »

  1.   

    String x=(String)session.getAttribute("department");
    String department=new String(x.getBytes("ISO-8859-1"),"gb2312");
    我就是这样写的
      

  2.   

    <%@ page language="java" import="java.util.*" pageEncoding="GBK" contentType="text/html;charset=GBK"%>
    <%    
          request.setCharacterEncoding("GBK");  
       //   response.setContentType("text/html;charset=GBK");  
    %>
    用的是GB2312吧  那就把所有GBK 换成GB2312
    如果还不好使的话就 建议用下过滤器了
      

  3.   

    你可以用httpWatch看一下,取出的数据是什么编码?