Android之解决PC端上传http表单格式文件手机解析文件名乱码问题和PC浏览器下载文件的文件名显示乱码问题

1 问题

  • 问题1、

    手机写socket作为服务器,PC浏览器上传http表单格式文件,然后手机端解析携带中文的文件名我解析是乱码。

  • 问题2、

   手机写了socket作为服务器,PC浏览器下载文件,但是浏览器里面的文件名有中文的时候会有乱码。

2 分析

问题1分析

    User-Agent: PostmanRuntime/7.26.1
    Accept: */*
    Cache-Control: no-cache
    Postman-Token: c7e5e240-4398-4ac6-ba7f-98e99b5b4a01
    Host: 10.15.42.180:9999
    Accept-Encoding: gzip, deflate, br
    Connection: keep-alive
    Content-Type: multipart/form-data; boundary=--------------------------118331203760563697512606
    Content-Length: 221
    
    ----------------------------118331203760563697512606   52 * 2 = 104       52 + 2 = 54
    Content-Disposition: form-data; name="chengyuimage"; filename="1.txt"     69  + 2  = 71
    Content-Type: text/plain                                                  24 + 2 = 26 
                                             

猜你喜欢

转载自blog.csdn.net/u011068702/article/details/107571777