Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't extract chinese filename when diff os #159

Closed
xiao-e-yun opened this issue Jun 1, 2024 · 3 comments · Fixed by #182
Closed

Can't extract chinese filename when diff os #159

xiao-e-yun opened this issue Jun 1, 2024 · 3 comments · Fixed by #182
Labels
bug Something isn't working

Comments

@xiao-e-yun
Copy link

Describe the bug
When adding a Chinese filename to an archive on Windows, the true filename cannot be extracted on Linux.

To Reproduce
Steps to reproduce the behavior:

  1. Create 你好.txt (space file).
  2. Add to hello.zip move file to linux.
  3. Run extract example cargo run --release --example extract -- hello.zip.
  4. Extract will be File 0 extracted to "ºAªn.txt" (0 bytes).

Expected behavior
Extract will be 你好.txt

Screenshots
image

Desktop

  • Version: Windows 10 Pro
  • Version: 22H2
  • Installation Date: May 4, 2024
  • OS Build: 19045.4355
  • Experience: Windows Feature Experience Pack 1000.19056.1000.0
  • 7-Zip 24.06 (2024-05-26) for Windows
    image

Server

  • OS: Arch Linux x86_64
  • Host: B450 AORUS ELITE
  • Kernel: 6.8.7-arch1-1
  • Uptime: 4 mins
  • Packages: 398 (pacman)
  • Shell: zsh 5.9
  • Terminal: /dev/pts/0
  • CPU: AMD Ryzen 7 2700X (16) @ 3.700GHz
  • GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 5700/5700 XT
  • Memory: 1735MiB / 15933MiB
@xiao-e-yun xiao-e-yun added the bug Something isn't working label Jun 1, 2024
@Pr0methean Pr0methean added the help wanted Extra attention is needed label Jun 2, 2024
@Pr0methean
Copy link
Member

Pr0methean commented Jun 2, 2024

Could you please upload the file hello.zip that you experienced this with? I don't have easy access to a Windows PC. I'm working on a possible fix, but need an example to test it on. It's possible that this is a bug in 7zip rather than in this crate.

@xiao-e-yun
Copy link
Author

xiao-e-yun commented Jun 3, 2024

Only empty file 你好.txt
windows-builtin.zip
windows-7zip.zip
linux-7z.zip

@Pr0methean Pr0methean reopened this Jun 3, 2024
This was referenced Jun 4, 2024
@Pr0methean
Copy link
Member

For windows-builtin.zip, this is a bug in Windows - it writes the filename as UTF-8 but doesn't set the Language Encoding flag. When clear, that flag incorrectly identifies the filename encoding as CP437.

For both 7zip files, this will be fixed in v2.1.3.

@Pr0methean Pr0methean added fix merged Fix is merged, but the issue will stay open until it's released. and removed help wanted Extra attention is needed labels Jun 4, 2024
Pr0methean added a commit that referenced this issue Jun 4, 2024
@Pr0methean Pr0methean removed the fix merged Fix is merged, but the issue will stay open until it's released. label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants