不用再处理了String str = new String("里边12.java".getBytes("GB2312"),"ISO-8859-1"); 
出来的就已经是中文了,在JSP可以直接使用

解决方案 »

  1.   

    不加这个设置--<%@ page contentType="text/html;charset=gb2312" %>
    时是可以读到中文了,
    可是其它的中文内容又不见了。
    难道分框架来显示?
    难道是resin的问题?
      

  2.   

    你没明白楼上的意思:
    如果加上<%@ page contentType="text/html;charset=gb2312" %>
    就看不到附件的中文标题,说明这时已经不用对标题解码了。
    你可以试试String strName = new Stringattachment.getFilename().getBytes("GB2312"),"ISO-8859-1");