Some Zip do not specify a filename encoding

Hi all,

the bug was squashed, but will appears in Xojo 2025r3 (so in nearly 3 ponts).

For the mean time, is it to get this information before trying to UnZip it (no crash, just a reported error when trying to expand it), but in my process, I create a folder with the zip name and copy the zip to that folder; the error arise when the zip hold a file without a File Name Encoding. In today batch of 22 zip (or cbr) archives, I had 2 zip archives that are in that case, and a decoding folder was created and a .txt (info) file.

To avoid that (do not copy a Folder where the zip will be copied / expanded), the only solution is to check if the File Name Encoding information is not available.

The question is:
Is it possible to know if an encoding is set to all file names inside the .zip file ?

About the Creation and Modification dates discrepency:
What I know about the .txt info file based on the first of the two files as expanded by macOS:

All files (.jpg and .txt) creation dates are older (2013) than the Modification Dates (2007),
The .txt file Creation and Modification dates are 2017.

My conclusion is: someone added on that year an info .txt file and in some way (I do not know) moves the files from Windows (where the process was done ?) to macOS, then creates the .zip file.
Why files have been moved from Windows to macOS ?
Because I had that when I readed an SQLite created with Xojo and moved in macOS: the dates were inverted in the copy process (with a Memory Card).
The splash screen displays (not only that) the number of Entries and the number of Current people, and the date of the last .SQLite modification (from the FolderItem.Modification Date).
This works fine when the Last Modification (Date) was done on macOS, but it is the Creation Date (useless in the context).
That was a way to not stree the user while saying the working .SQLite is unavailable: (s)he moved it from the default location.

BTW: another solution is to not use Xojo to uncompress the zip files and use the way I do for .rar files (the OS have the charge to uncompress the .rar files: I have an application who uncompress everything).

The zip file I was working on was created with either MSDOS, OS / 2 or NT FAT, NTFS was used to store it.

Only DosLatin and UTF8 are allowed for filenames in a zip archive. If you read the local file header, the encoding is indicated using the general purpose bit flag field.

Const FLAG_UTF8_NAME = 2048
Dim header As MemoryBlock(30) ' contains a local file header
Dim flags As UInt16 = header.UInt16Value(6)
Dim isUTF8 As Boolean 
If BitAnd(flags, FLAG_UTF8_NAME) <> 0 Then
  isUTF8 = True
End If

In fact, the problem lies with old zip archive who predates the Encoding addition in ZIP archives that appeared in 2006 (I think).

Due to the slow software upgrades, some people continues to create zip without encoding.

Also, people who share data in zip never update these files. My test file have been modified since its original creation (a file have been added to it *).

I read in the wikipedia page this is possible (removing a file from a zip file is also possible).