File tree Expand file tree Collapse file tree
resources/xcode/NativePHP Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,18 @@ class AppUpdateManager {
118118 var fileDataMap : [ ( path: URL , data: Data ) ] = [ ]
119119
120120 for entry in archive {
121- let destinationPath = destinationURL. appendingPathComponent ( entry. path)
121+ // ZIPFoundation 0.9.19's `entry.path` decodes as CP437 unless the EFS bit
122+ // is set on the entry — and macOS `zip` often omits that flag even for
123+ // UTF-8 names, producing mojibake (⚡️ → ΓÜí∩╕Å). Force UTF-8 decode via
124+ // path(using:); fall back to `entry.path` only if the bytes aren't valid
125+ // UTF-8 (which shouldn't happen for archives we build).
126+ let utf8Path = entry. path ( using: . utf8)
127+ let rawPath = utf8Path. isEmpty ? entry. path : utf8Path
128+
129+ // Normalize to NFC: macOS sources may emit NFD filenames; iOS APFS stores
130+ // bytes verbatim, but PHP autoloaders look up the NFC form.
131+ let normalizedPath = ( rawPath as NSString ) . precomposedStringWithCanonicalMapping
132+ let destinationPath = destinationURL. appendingPathComponent ( normalizedPath)
122133
123134 switch entry. type {
124135 case . directory:
You can’t perform that action at this time.
0 commit comments