URLEncoder.encode  我每次传入不同的中文 4个字的 出来的结果是 %3F%3F%3F%3F ,这个是在服务器上的,linux 但是我在本机的不会这样,windows 

解决方案 »

  1.   

    你在 URLEncoder.encode 的第二个参数用的是什么?你也好奇怪,问题都不说清楚!
      

  2.   

    服务器配置文件中有个对url设置编码的地方
      

  3.   

    public static String encode(String s,
                                String enc)
                         throws UnsupportedEncodingException    Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding scheme to obtain the bytes for unsafe characters.    Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.    Parameters:
            s - String to be translated.
            enc - The name of a supported character encoding. 
        Returns:
            the translated String.