subject=new String(subject.getBytes("iso8859-1"),"gb2312");问题是不是出在这段代码上呢?看不太懂
网站是别人做的,现在是我维护网站,但是我不太懂支付宝这个,请高手们指点一下
ps:我不太懂得技术

解决方案 »

  1.   

    这个好像是get请求的处理方法,你看看地址栏,要不先看看数据库里面是不是乱码?
      

  2.   

    很简单,写个Filter,把form表单中的method设为post
    public class FontFilter implements Filter {    public FontFilter() {    } public void destroy() { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    chain.doFilter(request, response);
    } public void init(FilterConfig fConfig) throws ServletException { }}
      

  3.   

    以前写过,全部是UTF-8编码,没遇到这种问题。我觉得支付宝返回的数据应该是UTF-8格式的。对各种语言都兼容嘛
      

  4.   

    看看页面里面使用的是哪种编码? 然后再看用到过滤器没有。。如果都有 在看看那个乱码哪里是通过哪种方式显示的。。如果是通过URL传参 那就要 subject=new String(subject.getBytes("iso8859-1"),"gb2312"); 这样转码了。。你看页面上是不是gb2312的。