解决方案 »

  1.   


    String encoder = URLEncoder.encode("哀伤");
    System.out.println(encoder);
    String decoder = URLDecoder.decode(encoder);
    System.out.println(decoder);
    URLEncoder 编码  URLDecoder 解码 
      

  2.   

    我用一个URL指向那个音乐在服务器上的地址,英文的可以播放,中文的不能播放,这该怎么解决啊
      

  3.   

    编码问题,编码转化,使在后面获取到的url中中文不是乱码就可以了
      

  4.   

    可以看看你的请求filter之类的全局请求处理类里面看看
      

  5.   


    我的url中是中文,但就是经过URL编码之后,就访问不到了
      

  6.   

    按照2楼提供的方式,将url先编码,再解码。
    在后台取文件之前先解码,这样拿到的就是自己需要的名字了。
      

  7.   

    server.xml中的Connector标签中增加URIEncoding属性。
    参见:http://blog.csdn.net/lwowen/article/details/658314
      

  8.   

    编码问题。看你是什么码了,一般url都直接解析成URLcode
    或者你也可以
    def covert_to_unicode(msg):  
        '''''将转入的编码转换为unicode,只接受utf-8和unicode编码'''  
        __re_str = None  
        if isinstance(msg, unicode):  
            __re_str = msg  
        elif isinstance(msg, str):  
            try:  
                __re_str = msg.decode('utf-8')  
            except Exception, errinfo:  
                raise Exception, '%s,%s' % (errinfo, str(msg))  
        else:  
            raise Exception, '%s 必须为str或unicode类型' % msg  
        return __re_str 
      

  9.   

    不必纠结于中文名字你上传文件以后,重命名一下,生成一个UUID的文件名何必转码,解码,累啊