Hello,
when I create a zip file with a password that contains a section character (§), I cannot unzip that file with the same password when using 7-Zip 19.00 (x64) on Windows. When I use the command line 7z x out.zip (p7zip Version 15.14.1) in cygwin or WinRar I was able to extract all files. I reverted the commit b69843a and was able to create and unzip a zip file with a password that contains a section character.
I think the crucial code section is Zip4jUtil#convertCharArrayToByteArray(char[]). Code after reverting b69843a (was the only merge conflict):
public class Zip4jUtil {
...
public static byte[] convertCharArrayToByteArray(char[] charArray) {
byte[] bytes = new byte[charArray.length];
for (int i = 0; i < charArray.length; i++) {
bytes[i] = (byte) charArray[i];
}
return bytes;
}
...
convertCharArrayToByteArray("§".toCharArray()) without InternalZipConstants returns "�" and with InternalZipConstants "§".
Hello,
when I create a zip file with a password that contains a section character (§), I cannot unzip that file with the same password when using 7-Zip 19.00 (x64) on Windows. When I use the command line
7z x out.zip(p7zip Version 15.14.1) in cygwin or WinRar I was able to extract all files. I reverted the commit b69843a and was able to create and unzip a zip file with a password that contains a section character.I think the crucial code section is
Zip4jUtil#convertCharArrayToByteArray(char[]). Code after reverting b69843a (was the only merge conflict):convertCharArrayToByteArray("§".toCharArray())withoutInternalZipConstantsreturns "�" and withInternalZipConstants"§".