How to unzip file that that is not in UTF8 format in java

前端 未结 5 604
臣服心动
臣服心动 2020-12-10 19:24

I have a file e.g. test.zip. If I use a ZIP-tool like winrar, it\'s easy to extract (unzip test.zip to test.csv). But test.csv is not in UTF8 format. My problem here is, whe

5条回答
  •  一个人的身影
    2020-12-10 19:46

    No, zip files are not just for UTF-8 data. Zip files don't try to interpret the data within the files at all, and neither does the Java API.

    There may be issues around non-ASCII names of files, but the file contents themselves shouldn't be a problem at all. In your case, it looks like the name of the file is just test.zip, so you shouldn't be running into any name encoding issues.

    If the file can't be opened, then it sounds like you've got a different problem. Are you sure the file exists where you expect it to be?

提交回复
热议问题