I recently wrote a zip file I/O library called zipzap, but I\'m struggling with correctly decoding zip entry file names from arbitrary zip files.
Now, the PKWARE spe
At the moment situation is as following:
So the only way is to check if filename contains something like utf-8 characters (check description of utf8 encoding - first byte should be 110xxxxx, second - 10xxxxxx for 2-bytes encoded chars). If it is correct utf8 string - use utf8 encoding. If not - fall back to OEM/DOS encoding.
The only way to determine if the filename is encoded as UTF-8 without using the EFS flag is to check to see if the high order bit is set in one of the characters. That could possibly mean that the character is UTF-8 encoded. However, it could still be the other way as there are some characters in CP437 that have the high order bit set and aren't meant to be decoded as UTF-8.
I would stick to the PKWARE app note specification and not hack in a solution that tries to conform to every known zip application in existence.