weichsel / ZIPFoundation

Effortless ZIP Handling in Swift
MIT License
2.34k stars 263 forks source link

addEntry adds a corrupted file?? #338

Closed wi-11 closed 1 month ago

wi-11 commented 1 month ago

Summary

addEntry adds a file but the entry contains slightly different data or corrupted data

Steps to Reproduce

When adding entry to an archive, if the file is a plist file with no extension (ex. "data") and has a [String : Any] dictionary and one of the key of the dictionary contains number, addEntry adds the file but the data of the entry is slightly different or corrupted. If no key in the dictionary contains number, addEntry works perfectly so I don't think my code is the problem probably But if a key contains number, addEntry changes the dictionary's keys and values

example -

original dictionary on document "f1" = 0, "abc" = 123, "cde" = 321, "abc123" = 123

dictionary from entry "f2" = 1, "abc" = 123, "cde" = 321

"f1" became "f2" and "abc123" is missing

Expected Results

The data of the plist file on document bplist00ÑRf1

the key of the dictionary is "f1"

Actual Results

The data of the plist file of the entry bplist00ÑRf0

The key of the dictionary is "f0"

스크린샷 2024-09-24 오후 11 28 02

Regression & Version

Xcode 16.0, swift 5

Related Link