mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
zip format, Chinese password decompression failed #413
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @toolgood on GitHub (Aug 29, 2020).
zip format, Chinese password decompression failed
Knowing that the password is "公众号身披御光的盟国"
But the decompression failed
Encoding: GB18030
test file: https://github.com/toolgood/OtherFiles/blob/master/SharpCompress/passwordError.zip
@toolgood commented on GitHub (Aug 29, 2020):
Use the 7-Zip Extra command line to decompress correctly
7-Zip Extra can be downloaded at https://www.7-zip.org/download.html
@adamhathcock commented on GitHub (Aug 29, 2020):
Thanks for the repro steps. I'll look at this soon.
Not sure why encoding has been difficult for me in this project. I assume UTF8 doesn't work?
@CasualPokePlayer commented on GitHub (May 10, 2023):
This doesn't actually work correctly unless you're on a Chinese system anyways (which seems to use GB18030 for Command Prompt, as that's the system page). What gets sent to 7zip is ultimately just a byte array, which on your system is decoded correctly from the string using GB18030. On other systems (like English systems using Windows-1252), it will not work (as those characters are unsupported). That is unless you translate the raw bytes into the user's system page. For Windows-1252, this would be
¹«ÖÚºÅÉíÅûÓù¹âµÄÃ˹ú. As long as the string gets decoded into the correct byte array, it works.